Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
shebang-command
Advanced tools
Get the command from a shebang
Weekly downloads
Package description
The shebang-command npm package is used to parse the shebang (#!) line of a file to determine which interpreter should be used to execute the file. This is particularly useful when working with scripts in a Node.js environment where you might need to identify the interpreter specified in a script file.
Parse shebang line
This feature allows you to extract the command from the shebang line of a script. The code sample represents a script file with a shebang line that specifies that the script should be run with Node.js.
"#!/usr/bin/env node\nconsole.log('Hello, world!');"
The shebang-regex package provides a regular expression for matching shebang lines. It is similar to shebang-command in that it helps with shebang lines, but it does not parse the line to extract the command; it only provides the regex for matching.
The hashbang package is another tool that can be used to manage shebang lines in scripts. It is similar to shebang-command but offers a different API and might have different use cases or preferences for developers.
Readme
Get the command from a shebang
$ npm install shebang-command
const shebangCommand = require('shebang-command');
shebangCommand('#!/usr/bin/env node');
//=> 'node'
shebangCommand('#!/bin/bash');
//=> 'bash'
Type: string
String containing a shebang.
FAQs
Get the command from a shebang
The npm package shebang-command receives a total of 48,022,957 weekly downloads. As such, shebang-command popularity was classified as popular.
We found that shebang-command 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
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.