index.js 341 B

123456789101112131415161718
  1. /*!
  2. * fs-exists-sync (https://github.com/jonschlinkert/fs-exists-sync)
  3. *
  4. * Copyright (c) 2016, Jon Schlinkert.
  5. * Licensed under the MIT License.
  6. */
  7. 'use strict';
  8. var fs = require('fs');
  9. module.exports = function(filepath) {
  10. try {
  11. (fs.accessSync || fs.statSync)(filepath);
  12. return true;
  13. } catch (err) {}
  14. return false;
  15. };