New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

js-exec-utils

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-exec-utils

nodejs: Execute script/module/package/function in shell

latest
Source
npmnpm
Version
1.0.8
Version published
Maintainers
1
Created
Source

js-exec-utils

介绍

nodejs: 支持命令行运行js脚本/模块/包/函数

安装教程

npm install js-exec-utils

使用说明

eg: math.js

const {runIfMain} = require("js-exec-utils");
module.exports = {
    name: 'math calculator',
    tips: `node ${__filename} sum ...args`,
    sum: (...args) => {
        return [0, ...args].reduce((a, b) => Number(a) + Number(b));
    }
};
runIfMain(__filename, module.exports);

可执行 shell 命令: node math.js sum 1 2 3 4

Keywords

nodejs

FAQs

Package last updated on 05 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts