
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Because sometimes you want to write shell scripts with JavaScript instead of bash.
Uses a fork of shell-escape-tag to escape values.
import sh from 'shell-tag'
const lsOutput = sh`ls -1`
// => "index.js
// node_modules
// package.json
// readme.md
// test-helper
// test.js"
You can even use javascript variables inside your bash code!
import sh from 'shell-tag'
const str = 'say "what"'
const echoOutput = sh`echo ${str}`
// => say "what"
Throws errors if a non-0 exit code is returned. Otherwise, returns the string from stdout.
An async version is available:
import sh from 'shell-tag/async'
const str = 'say "what"'
(async() => {
const echoOutput = await sh`cat package.json | grep name`
// => ' "name": "shell-tag",\n'
})()
FAQs
Run shell commands inline in JavaScript with ES6 template strings
The npm package shell-tag receives a total of 1,622 weekly downloads. As such, shell-tag popularity was classified as popular.
We found that shell-tag demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.