BVB Source Codes

reactide Show exists.js Source code

Return Download reactide: download exists.js Source code - Download reactide Source code - Type:.js
  1. 'use strict';
  2.  
  3. var fs = require('fs');
  4. /**
  5.  * Check if file exists and cache the result
  6.  * return the result in cache
  7.  *
  8.  * @example
  9.  * var exists = require('./helpers/fsExists')({});
  10.  * exists('.babelrc'); // false
  11.  */
  12. module.exports = function(cache) {
  13.   cache = cache || {};
  14.  
  15.   return function(filename) {
  16.  
  17.     if (!filename) { return false; }
  18.  
  19.     cache[filename] = cache[filename] || fs.existsSync(filename);
  20.  
  21.     return cache[filename];
  22.   };
  23. };
  24.  
downloadexists.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top