Skip to content

Sandboxed Wrapper for Node.js File System API

License

Notifications You must be signed in to change notification settings

mille-nium/sandboxed-fs

 
 

Repository files navigation

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

About

Sandboxed Wrapper for Node.js File System API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%