JSPM

fs-access

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 333516
  • Score
    100M100P100Q34892F
  • License MIT

Node.js 0.12 fs.access() & fs.accessSync() ponyfill

Package Exports

  • fs-access

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fs-access) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

fs-access Build Status

Node.js 0.12 fs.access() & fs.accessSync() ponyfill

Ponyfill: A polyfill that doesn't overwrite the native method

Install

$ npm install --save fs-access

Usage

var fsAccess = require('fs-access');

fsAccess('unicorn.txt', function (err) {
    if (err) {
        console.error('no access');
        return;
    }

    console.log('access');
});
var fsAccess = require('fs-access');

try {
    fsAccess.sync('unicorn.txt');
    console.log('access');
} catch (err) {
    console.error('no access');
}

API

See the fs.access() & fs.accessSync() docs.

Mode flags are on the fsAccess instance instead of fs.

Only the F_OK mode is supported for now. Help welcome for additional modes.

License

MIT © Sindre Sorhus