Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/fs-access
Node.js 0.12 fs.access() & fs.accessSync() ponyfill
https://github.com/sindresorhus/fs-access
deprecated
Last synced: 10 days ago
JSON representation
Node.js 0.12 fs.access() & fs.accessSync() ponyfill
- Host: GitHub
- URL: https://github.com/sindresorhus/fs-access
- Owner: sindresorhus
- License: mit
- Archived: true
- Created: 2015-05-10T22:53:13.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2023-10-30T15:47:33.000Z (about 1 year ago)
- Last Synced: 2024-10-29T22:38:24.144Z (3 months ago)
- Topics: deprecated
- Language: JavaScript
- Size: 5.86 KB
- Stars: 11
- Watchers: 7
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
- Security: .github/security.md
Awesome Lists containing this project
README
# Deprecated
This package is no longer relevant as Node.js 0.12 is unmaintained.
---
# fs-access [![Build Status](https://travis-ci.org/sindresorhus/fs-access.svg?branch=master)](https://travis-ci.org/sindresorhus/fs-access)
> Node.js 0.12 [`fs.access()`](https://nodejs.org/api/fs.html#fs_fs_access_path_mode_callback) & [`fs.accessSync()`](https://nodejs.org/api/fs.html#fs_fs_accesssync_path_mode) [ponyfill](https://ponyfill.com)
## Install
```
$ npm install --save fs-access
```## Usage
```js
var fsAccess = require('fs-access');fsAccess('unicorn.txt', function (err) {
if (err) {
console.error('no access');
return;
}console.log('access');
});
``````js
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](https://nodejs.org/api/fs.html#fs_fs_access_path_mode_callback).
Mode flags are on the `fsAccess` instance instead of `fs`. Only the `F_OK` mode is supported.
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)