pax_global_header00006660000000000000000000000064134610313220014505gustar00rootroot0000000000000052 comment=27a9a6f0f85c04b9c37a43cf7503fdb58f5ae8d6 shebang-regex-3.0.0/000077500000000000000000000000001346103132200142245ustar00rootroot00000000000000shebang-regex-3.0.0/.editorconfig000066400000000000000000000002571346103132200167050ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.yml] indent_style = space indent_size = 2 shebang-regex-3.0.0/.gitattributes000066400000000000000000000000231346103132200171120ustar00rootroot00000000000000* text=auto eol=lf shebang-regex-3.0.0/.gitignore000066400000000000000000000000271346103132200162130ustar00rootroot00000000000000node_modules yarn.lock shebang-regex-3.0.0/.npmrc000066400000000000000000000000231346103132200153370ustar00rootroot00000000000000package-lock=false shebang-regex-3.0.0/.travis.yml000066400000000000000000000000651346103132200163360ustar00rootroot00000000000000language: node_js node_js: - '12' - '10' - '8' shebang-regex-3.0.0/index.d.ts000066400000000000000000000006761346103132200161360ustar00rootroot00000000000000/** Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line. @example ``` import shebangRegex = require('shebang-regex'); const string = '#!/usr/bin/env node\nconsole.log("unicorns");'; shebangRegex.test(string); //=> true shebangRegex.exec(string)[0]; //=> '#!/usr/bin/env node' shebangRegex.exec(string)[1]; //=> '/usr/bin/env node' ``` */ declare const shebangRegex: RegExp; export = shebangRegex; shebang-regex-3.0.0/index.js000066400000000000000000000000521346103132200156660ustar00rootroot00000000000000'use strict'; module.exports = /^#!(.*)/; shebang-regex-3.0.0/index.test-d.ts000066400000000000000000000001471346103132200171040ustar00rootroot00000000000000import {expectType} from 'tsd'; import shebangRegex = require('.'); expectType(shebangRegex); shebang-regex-3.0.0/license000066400000000000000000000021251346103132200155710ustar00rootroot00000000000000MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. shebang-regex-3.0.0/package.json000066400000000000000000000011061346103132200165100ustar00rootroot00000000000000{ "name": "shebang-regex", "version": "3.0.0", "description": "Regular expression for matching a shebang line", "license": "MIT", "repository": "sindresorhus/shebang-regex", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "regex", "regexp", "shebang", "match", "test", "line" ], "devDependencies": { "ava": "^1.4.1", "tsd": "^0.7.2", "xo": "^0.24.0" } } shebang-regex-3.0.0/readme.md000066400000000000000000000012111346103132200157760ustar00rootroot00000000000000# shebang-regex [![Build Status](https://travis-ci.org/sindresorhus/shebang-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/shebang-regex) > Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line ## Install ``` $ npm install shebang-regex ``` ## Usage ```js const shebangRegex = require('shebang-regex'); const string = '#!/usr/bin/env node\nconsole.log("unicorns");'; shebangRegex.test(string); //=> true shebangRegex.exec(string)[0]; //=> '#!/usr/bin/env node' shebangRegex.exec(string)[1]; //=> '/usr/bin/env node' ``` ## License MIT © [Sindre Sorhus](https://sindresorhus.com) shebang-regex-3.0.0/test.js000066400000000000000000000003451346103132200155430ustar00rootroot00000000000000import test from 'ava'; import shebangRegex from '.'; test('main', t => { t.true(shebangRegex.test('#!/usr/bin/env node\nconsole.log("unicorns");')); t.is(shebangRegex.exec('#!/usr/bin/env node')[1], '/usr/bin/env node'); });