Node-restrict

码农软件 · 软件分类 · Node.js 扩展 · 2019-04-14 18:29:44

软件介绍

Node-restrict 能够阻止应用程序使用 procss.binding('process_wrap'), process.kill 和 child_process 的 Nodejs 模块。

代码示例:

var restrict = require('restrict');
// ls is whitelisted
restrict({
    'whitelist': ['ls'],
    'whitelistPath': ['/bin']
});

//set whitelist can be invoked, if the whitelist is dynamic
restrict.setWhitelist(['grep'], ['/bin', '/usr/bin']);

var child_process = require('child_process');
try {
    // ls is whitelisted. So you can see the output of ls
    child_process.exec('/bin/ls', function (err, stdout, stderr) {
        console.log(stdout);
    });
    // grep is not whitelisted. Exception thrown
    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);
}

本文地址:https://codercto.com/soft/d/3582.html

软件调试

软件调试

张银奎 / 电子工业出版社 / 2008-6 / 128.00元

围绕如何实现高效调试这一主题,本书深入系统地介绍了以调试器为核心的各种软件调试技术。本书共30章,分为6篇。第1篇介绍了软件调试的概况和简要历史。第2篇以英特尔架构(IA)的CPU为例,介绍了计算机系统的硬件核心所提供的调试支持,包括异常、断点指令、单步执行标志、分支监视、JTAG和MCE等。第3篇以Windows操作系统为例,介绍了计算机系统的软件核心中的调试设施,包括内核调试引擎、用户态调试子......一起来看看 《软件调试》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

URL 编码/解码
URL 编码/解码

URL 编码/解码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具