Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

shebang-command

kevva302.5mMIT2.0.0TypeScript support: definitely-typed

Get the command from a shebang

cmd, command, parse, shebang

readme

shebang-command Build Status

Get the command from a shebang

Install

$ npm install shebang-command

Usage

const shebangCommand = require('shebang-command');

shebangCommand('#!/usr/bin/env node');
//=> 'node'

shebangCommand('#!/bin/bash');
//=> 'bash'

API

shebangCommand(string)

string

Type: string

String containing a shebang.