shebang-command
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
shebang-regex | 3.0.0 | 1.47 kB | MIT | prod |
The "shebang-command" is a potent tool that interprets and extracts the command from a shebang, an essential part of many scripting languages.
To use the "shebang-command", first, install it in your project using npm with the following command:
$ npm install shebang-command
After that, you can import it into your JavaScript file and use it as follows:
const shebangCommand = require('shebang-command');
shebangCommand('#!/usr/bin/env node');
// Returns: 'node'
shebangCommand('#!/bin/bash');
// Returns: 'bash'
This package simply requires a string input containing a shebang, and it will output the corresponding command.
The documentation for "shebang-command" is rather straightforward and it can be found right in the readme file on the package's GitHub repository at https://github.com/kevva/shebang-command. It provides all the necessary details for getting started, including the installation process and usage examples.