Awesome Open Source
Awesome Open Source

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:

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');
});

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Javascript (1,551,389
Nodejs (54,478
Api (22,117
Node (13,059
Js (9,552
Security (8,692
Wrapper (2,402
Filesystem (1,898
Sandbox (542
Lock (446
Fs (366
Related Projects