Skip to content

Commit 9a2f994

Browse files
committed
Requrie Node.js 12.20
1 parent cea4eb4 commit 9a2f994

File tree

10 files changed

+74
-91
lines changed

10 files changed

+74
-91
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ charset = utf-8
77
trim_trailing_whitespace = true
88
insert_final_newline = true
99

10-
[{package.json,*.yml}]
10+
[*.yml]
1111
indent_style = space
1212
indent_size = 2

.gitattributes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
* text=auto
2-
*.js text eol=lf
1+
* text=auto eol=lf

.github/workflows/main.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,10 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
node-version:
13-
- 14
14-
- 12
15-
- 10
16-
- 8
17-
- 6
18-
- 4
13+
- 16
1914
steps:
2015
- uses: actions/checkout@v2
21-
- uses: actions/setup-node@v1
16+
- uses: actions/setup-node@v2
2217
with:
2318
node-version: ${{ matrix.node-version }}
2419
- run: npm install

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
yarn.lock

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

cli.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/usr/bin/env node
2-
'use strict';
3-
const meow = require('meow');
4-
const npmRunPath = require('npm-run-path');
2+
import meow from 'meow';
3+
import {npmRunPath} from 'npm-run-path';
54

65
meow(`
76
Example
87
$ export PATH="$(npm-run-path)"
9-
`);
8+
`, {
9+
importMeta: import.meta,
10+
});
1011

1112
console.log(npmRunPath());

license

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
1-
The MIT License (MIT)
1+
MIT License
22

3-
Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)
3+
Copyright (c) Sindre Sorhus <[email protected]> (https://sindresorhus.com)
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
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:
116

12-
The above copyright notice and this permission notice shall be included in
13-
all copies or substantial portions of the Software.
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
148

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
9+
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.

package.json

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,50 @@
11
{
2-
"name": "npm-run-path-cli",
3-
"version": "1.1.0",
4-
"description": "Get your PATH prepended with locally installed binaries",
5-
"license": "MIT",
6-
"repository": "sindresorhus/npm-run-path-cli",
7-
"author": {
8-
"name": "Sindre Sorhus",
9-
"email": "[email protected]",
10-
"url": "sindresorhus.com"
11-
},
12-
"bin": {
13-
"npm-run-path": "cli.js"
14-
},
15-
"engines": {
16-
"node": ">=4"
17-
},
18-
"scripts": {
19-
"test": "xo && ava"
20-
},
21-
"files": [
22-
"cli.js"
23-
],
24-
"keywords": [
25-
"cli-app",
26-
"cli",
27-
"npm",
28-
"run",
29-
"path",
30-
"package",
31-
"bin",
32-
"binary",
33-
"binaries",
34-
"script",
35-
"command-line",
36-
"execute",
37-
"executable"
38-
],
39-
"dependencies": {
40-
"meow": "^3.6.0",
41-
"npm-run-path": "^2.0.2"
42-
},
43-
"devDependencies": {
44-
"ava": "*",
45-
"execa": "^0.6.0",
46-
"xo": "*"
47-
}
2+
"name": "npm-run-path-cli",
3+
"version": "1.1.0",
4+
"description": "Get your PATH prepended with locally installed binaries",
5+
"license": "MIT",
6+
"repository": "sindresorhus/npm-run-path-cli",
7+
"funding": "https://github.com/sponsors/sindresorhus",
8+
"author": {
9+
"name": "Sindre Sorhus",
10+
"email": "[email protected]",
11+
"url": "https://sindresorhus.com"
12+
},
13+
"type": "module",
14+
"bin": {
15+
"npm-run-path": "./cli.js"
16+
},
17+
"engines": {
18+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
19+
},
20+
"scripts": {
21+
"test": "xo && ava"
22+
},
23+
"files": [
24+
"cli.js"
25+
],
26+
"keywords": [
27+
"cli-app",
28+
"cli",
29+
"npm",
30+
"run",
31+
"path",
32+
"package",
33+
"bin",
34+
"binary",
35+
"binaries",
36+
"script",
37+
"command-line",
38+
"execute",
39+
"executable"
40+
],
41+
"dependencies": {
42+
"meow": "^10.1.1",
43+
"npm-run-path": "^5.0.1"
44+
},
45+
"devDependencies": {
46+
"ava": "^3.15.0",
47+
"execa": "^5.1.1",
48+
"xo": "^0.45.0"
49+
}
4850
}

readme.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44
55
In [npm run scripts](https://docs.npmjs.com/cli/run-script) you can execute locally installed binaries by name. This enables the same outside npm.
66

7-
87
## Install
98

10-
```
11-
$ npm install --global npm-run-path-cli
9+
```sh
10+
npm install --global npm-run-path-cli
1211
```
1312

14-
1513
## Usage
1614

1715
```
@@ -21,12 +19,6 @@ $ npm-run-path --help
2119
$ export PATH="$(npm-run-path)"
2220
```
2321

24-
2522
## Related
2623

2724
- [npm-run-path](https://github.com/sindresorhus/npm-run-path) - API for this module
28-
29-
30-
## License
31-
32-
MIT © [Sindre Sorhus](https://sindresorhus.com)

test.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
import path from 'path';
1+
import path from 'node:path';
2+
import {fileURLToPath} from 'node:url';
23
import test from 'ava';
34
import execa from 'execa';
45

5-
test(async t => {
6+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
7+
8+
test('main', async t => {
9+
const {stdout} = await execa('./cli.js');
610
t.is(
7-
(await execa.stdout('./cli.js')).split(path.delimiter)[0],
8-
path.join(__dirname, 'node_modules/.bin')
11+
stdout.split(path.delimiter)[0],
12+
path.join(__dirname, 'node_modules/.bin'),
913
);
1014
});

0 commit comments

Comments
 (0)