Skip to content

Nodejs module that blocks applications from using procss.binding('process_wrap'), process.kill and child_process methods.

License

Notifications You must be signed in to change notification settings

rohiniwork/node-restrict

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

restrict

Nodejs module that blocks applications from using procss.binding('process_wrap'), process.kill and child_process methods. This protects applications from invoking these methods unintentionally, that could harm the functioning of the framework or application being developed.

This package is tested only with Node versions 8 and 10.

install

With npm do:

npm install restrict

usage

require('restrict');

var child_process = require('child_process');
try {
    child_process.spawn('grep', ['ssh']);
} catch (e) {
    //this will throw an error
    //[Error: Function call spawn() is prohibited in this environment.]
    console.log(e);
}
try {
    process.kill(30);
} catch (e) {
    //this will throw an error
    //[Error: Function call process.kill() is prohibited in this environment.]
    console.log(e);
}

Build Status

Build Status

Node Badge

NPM

About

Nodejs module that blocks applications from using procss.binding('process_wrap'), process.kill and child_process methods.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%