Needful Program Management
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

sandboxed-fs

0.3.2 • Public • Published

sandboxedFs

npm version Build Status NPM Downloads/Month NPM Downloads

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

install

npm i sandboxed-fs

Downloadsweekly downloads

36

version

0.3.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability