Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/metarhia/sandboxed-fs
Sandbox wrapper for Node.js File System API 💾
https://github.com/metarhia/sandboxed-fs
api application-sandbox application-security application-server filesystem fs impress javascript js lock metarhia node nodejs sandbox sandboxed sandboxing security wrapper
Last synced: 2 days ago
JSON representation
Sandbox wrapper for Node.js File System API 💾
- Host: GitHub
- URL: https://github.com/metarhia/sandboxed-fs
- Owner: metarhia
- License: other
- Created: 2017-02-17T22:01:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-07-19T16:01:00.000Z (4 months ago)
- Last Synced: 2024-08-09T22:35:46.871Z (3 months ago)
- Topics: api, application-sandbox, application-security, application-server, filesystem, fs, impress, javascript, js, lock, metarhia, node, nodejs, sandbox, sandboxed, sandboxing, security, wrapper
- Language: JavaScript
- Homepage: https://metarhia.com
- Size: 173 KB
- Stars: 47
- Watchers: 15
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
sandboxed-fs`sandboxed-fs` is a sandboxed wrapper for Node.js file system module implementing
the same API but bound to a certain directory, reliably locked in it.## Usage
- Install: `npm install sandboxed-fs`
- Require: `const fs = require('sandboxed-fs').bind(path);`## Examples:
```javascript
const fs = require('sandboxed-fs').bind(path);fs.readFile('file.ext', (err, data) => {
if (err) return console.log('Cannot read file');
});fs.readFile('../../file.ext', (err, data) => {
if (err) return console.log('Cannot read file');
});
```