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: 9 months 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 9 years ago)
- Default Branch: master
- Last Pushed: 2024-07-19T16:01:00.000Z (almost 2 years ago)
- Last Synced: 2025-08-21T10:10:56.537Z (10 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: 50
- Watchers: 14
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Authors: AUTHORS
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');
});
```