
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
node-powershell
Advanced tools
Lightweight module to run PowerShell straight from your Node app
$ npm i -S node-powershell
var shell = require('node-powershell');
var ps = new shell({executionPolicy: 'Bypass', debugMsg: true});
ps.addCommand('echo "node-powershell rocks"');
.then(function(){
return ps.invoke();
})
.then(function(output){
console.log(output);
ps.dispose();
})
.catch(function(err){
console.log(err);
ps.dispose();
});
require('node-powershell')Provides promise based methods that are used to create a pipeline of commands and invoke those commands within a PowerShell runspace.
Creates a new shell instance.
var ps = new shell(options);
options:
| Name | Description |
|---|---|
| history | An array containing the command history ever added to the shell. |
| streams | An object containing the sdtio (in,out,err) of the PowerShell Instance. |
| Name | Description | Syntax | Return Value |
|---|---|---|---|
| addCommand(command, params = []) | Adds a command to the end of the pipeline of the shell object. | ps.addCommand('./script.ps1', [{name:'str', value:'node-powershell rocks'}]); | A promise of the commands. |
| invoke() | Runs the commands of the shell object pipeline. | ps.invoke(); | A promise with the result (can also be rejected to the catch). |
| dispose() | Releases all resources used by the shell object and closes the PowerShell child_process. | ps.dispose(); | A promise of the exit code. |
| Name | Description | Syntax |
|---|---|---|
| output | Emits when shell has an output. | ps.on('output', data=>{}); |
| err | Emits when shell has an error. | ps.on('err', error=>{}); |
| end | Emits when shell ends. | ps.on('end', code=>{}); |
Just use param ( ) instead of Read-Host in your script:
param (
[Parameter(Mandatory = $true)]
[string]$str
)
echo $str
and Shell.addCommand() with the params array in your node app.
for more examples please look at the example page.
FAQs
Node.js binding for PowerShell
The npm package node-powershell receives a total of 32,287 weekly downloads. As such, node-powershell popularity was classified as popular.
We found that node-powershell demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.