This commit is contained in:
Stephen Franceschelli 2019-07-30 13:41:05 -04:00
parent 596a6da241
commit c1a589c5b6
7078 changed files with 1882834 additions and 319 deletions

9
node_modules/run-node/license generated vendored Normal file
View file

@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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.

73
node_modules/run-node/package.json generated vendored Normal file
View file

@ -0,0 +1,73 @@
{
"_from": "run-node@^1.0.0",
"_id": "run-node@1.0.0",
"_inBundle": false,
"_integrity": "sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A==",
"_location": "/run-node",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "run-node@^1.0.0",
"name": "run-node",
"escapedName": "run-node",
"rawSpec": "^1.0.0",
"saveSpec": null,
"fetchSpec": "^1.0.0"
},
"_requiredBy": [
"/husky"
],
"_resolved": "https://registry.npmjs.org/run-node/-/run-node-1.0.0.tgz",
"_shasum": "46b50b946a2aa2d4947ae1d886e9856fd9cabe5e",
"_spec": "run-node@^1.0.0",
"_where": "E:\\github\\setup-java\\node_modules\\husky",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bin": {
"run-node": "run-node"
},
"bugs": {
"url": "https://github.com/sindresorhus/run-node/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Run the Node.js binary no matter what",
"engines": {
"node": ">=4"
},
"files": [
"run-node"
],
"homepage": "https://github.com/sindresorhus/run-node#readme",
"keywords": [
"run",
"node",
"nodejs",
"node.js",
"find",
"binary",
"bin",
"execute",
"which",
"detect",
"path",
"env",
"bash",
"shell",
"sh"
],
"license": "MIT",
"name": "run-node",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/run-node.git"
},
"scripts": {
"test": "./run-node --version"
},
"version": "1.0.0"
}

70
node_modules/run-node/readme.md generated vendored Normal file
View file

@ -0,0 +1,70 @@
# run-node [![Build Status](https://travis-ci.org/sindresorhus/run-node.svg?branch=master)](https://travis-ci.org/sindresorhus/run-node)
> Run the Node.js binary no matter what
You can't always assume running `$ node file.js` will just work. The user might have the `node` binary in a non-standard location. They might be using a Node.js version manager like `nvm`, which is sourced in a subshell and not available from the outside. It also depends from where you're trying to run it. For example, GUI apps on macOS doesn't inherit the [`$PATH`](https://en.wikipedia.org/wiki/PATH_(variable)), so the `node` binary would not be found. Most projects that depend on Node.js just end up telling the user to manually set the full path to the `node` binary in some project specific settings. Now every project has to do this. [Ugh...](https://gist.github.com/cookrn/4015437) I prefer things to *just* work. With this module it will.
This Bash script uses some tricks to find the Node.js binary on your system and run it.
Can be used from any environment that can spawn a process (Shell, Python, Ruby, Swift, Objective-C, etc).
### npm
#### Install
```
$ npm install run-node
```
#### Usage
```
$ ./node_modules/.bin/run-node file.js
```
Or in an [npm run script](https://docs.npmjs.com/cli/run-script):
```json
{
"start": "run-node file.js"
}
```
### Manually
#### Install
Download the [run-node](run-node) file:
```
$ curl -sSLO https://github.com/sindresorhus/run-node/raw/master/run-node && chmod +x run-node
```
#### Usage
```
./run-node file.js
```
#### Customizable cache path and error message
The cache path and error message are defined by the `RUN_NODE_CACHE_PATH` and `RUN_NODE_ERROR_MSG` environment variables. You could use them in a script or add them to your `~.bashrc`.
Default config:
```sh
export RUN_NODE_ERROR_MSG="Couldn't find the Node.js binary. Ensure you have Node.js installed. Open an issue on https://github.com/sindresorhus/run-node"
export RUN_NODE_CACHE_PATH="/home/username/.node_path"
```
## Created by
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Mathias Fredriksson](https://github.com/mafredri)
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

49
node_modules/run-node/run-node generated vendored Normal file
View file

@ -0,0 +1,49 @@
#!/usr/bin/env bash
# MIT License © Sindre Sorhus
if [[ -z $RUN_NODE_CACHE_PATH ]]; then
PATH_CACHE="$HOME"/.node_path
else
PATH_CACHE="$RUN_NODE_CACHE_PATH"
fi
get_user_path() {
[[ -x "/usr/libexec/path_helper" ]] && eval $(/usr/libexec/path_helper -s)
echo "$($SHELL -i -l -c 'echo -e "\n"PATH=\"$PATH:\$PATH\""\n"' 2>/dev/null | grep "^PATH=")" > "$PATH_CACHE"
}
set_path() {
if [[ -f "$PATH_CACHE" ]]; then
. "$PATH_CACHE"
else
get_user_path
. "$PATH_CACHE"
fi
export PATH
}
has_node() {
command -v node >/dev/null 2>&1
}
# Check if we have node, otherwise inherit path from user shell
if ! has_node; then
set_path
# Retry by deleting old path cache
if ! has_node; then
rm "$PATH_CACHE"
set_path
fi
fi
if has_node; then
node "$@"
else
if [[ -z $RUN_NODE_ERROR_MSG ]]; then
echo "Couldn't find the Node.js binary. Ensure you have Node.js installed. Open an issue on https://github.com/sindresorhus/run-node"
else
echo "$RUN_NODE_ERROR_MSG"
fi
fi