@dotpi/tools 2.9.2 → 2.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dotpi_root/dist/@dotpi/avahi-monitor-module/LICENSE +28 -0
- package/dotpi_root/dist/@dotpi/avahi-monitor-module/package.json +3 -2
- package/dotpi_root/dist/@dotpi/javascript/LICENSE +28 -0
- package/dotpi_root/dist/@dotpi/javascript/package.json +3 -2
- package/dotpi_root/dist/@dotpi/module/LICENSE +28 -0
- package/dotpi_root/dist/@dotpi/module/package.json +4 -3
- package/dotpi_root/dist/@dotpi/module-module/LICENSE +28 -0
- package/dotpi_root/dist/@dotpi/module-module/package.json +5 -4
- package/package.json +5 -5
- package/dotpi_root/dist/@dotpi/javascript/node_modules/figures/index.d.ts +0 -279
- package/dotpi_root/dist/@dotpi/javascript/node_modules/figures/index.js +0 -292
- package/dotpi_root/dist/@dotpi/javascript/node_modules/figures/license +0 -9
- package/dotpi_root/dist/@dotpi/javascript/node_modules/figures/package.json +0 -49
- package/dotpi_root/dist/@dotpi/javascript/node_modules/figures/readme.md +0 -337
- package/dotpi_root/dist/@dotpi/javascript/node_modules/human-signals/LICENSE +0 -201
- package/dotpi_root/dist/@dotpi/javascript/node_modules/human-signals/README.md +0 -180
- package/dotpi_root/dist/@dotpi/javascript/node_modules/human-signals/build/src/core.js +0 -273
- package/dotpi_root/dist/@dotpi/javascript/node_modules/human-signals/build/src/main.d.ts +0 -206
- package/dotpi_root/dist/@dotpi/javascript/node_modules/human-signals/build/src/main.js +0 -70
- package/dotpi_root/dist/@dotpi/javascript/node_modules/human-signals/build/src/realtime.js +0 -16
- package/dotpi_root/dist/@dotpi/javascript/node_modules/human-signals/build/src/signals.js +0 -34
- package/dotpi_root/dist/@dotpi/javascript/node_modules/human-signals/package.json +0 -64
- package/dotpi_root/dist/@dotpi/javascript/node_modules/is-plain-obj/index.d.ts +0 -35
- package/dotpi_root/dist/@dotpi/javascript/node_modules/is-plain-obj/index.js +0 -8
- package/dotpi_root/dist/@dotpi/javascript/node_modules/is-plain-obj/license +0 -9
- package/dotpi_root/dist/@dotpi/javascript/node_modules/is-plain-obj/package.json +0 -41
- package/dotpi_root/dist/@dotpi/javascript/node_modules/is-plain-obj/readme.md +0 -58
- package/dotpi_root/dist/@dotpi/javascript/node_modules/is-unicode-supported/index.d.ts +0 -12
- package/dotpi_root/dist/@dotpi/javascript/node_modules/is-unicode-supported/index.js +0 -21
- package/dotpi_root/dist/@dotpi/javascript/node_modules/is-unicode-supported/license +0 -9
- package/dotpi_root/dist/@dotpi/javascript/node_modules/is-unicode-supported/package.json +0 -47
- package/dotpi_root/dist/@dotpi/javascript/node_modules/is-unicode-supported/readme.md +0 -35
- package/dotpi_root/dist/@dotpi/javascript/node_modules/npm-run-path/index.d.ts +0 -90
- package/dotpi_root/dist/@dotpi/javascript/node_modules/npm-run-path/index.js +0 -55
- package/dotpi_root/dist/@dotpi/javascript/node_modules/npm-run-path/license +0 -9
- package/dotpi_root/dist/@dotpi/javascript/node_modules/npm-run-path/package.json +0 -52
- package/dotpi_root/dist/@dotpi/javascript/node_modules/npm-run-path/readme.md +0 -104
- package/dotpi_root/dist/@dotpi/javascript/node_modules/path-key/index.d.ts +0 -31
- package/dotpi_root/dist/@dotpi/javascript/node_modules/path-key/index.js +0 -12
- package/dotpi_root/dist/@dotpi/javascript/node_modules/path-key/license +0 -9
- package/dotpi_root/dist/@dotpi/javascript/node_modules/path-key/package.json +0 -41
- package/dotpi_root/dist/@dotpi/javascript/node_modules/path-key/readme.md +0 -57
- package/dotpi_root/dist/@dotpi/javascript/node_modules/strip-final-newline/index.d.ts +0 -18
- package/dotpi_root/dist/@dotpi/javascript/node_modules/strip-final-newline/index.js +0 -26
- package/dotpi_root/dist/@dotpi/javascript/node_modules/strip-final-newline/license +0 -9
- package/dotpi_root/dist/@dotpi/javascript/node_modules/strip-final-newline/package.json +0 -49
- package/dotpi_root/dist/@dotpi/javascript/node_modules/strip-final-newline/readme.md +0 -34
- package/dotpi_root/dist/@dotpi/module/node_modules/figures/index.d.ts +0 -279
- package/dotpi_root/dist/@dotpi/module/node_modules/figures/index.js +0 -292
- package/dotpi_root/dist/@dotpi/module/node_modules/figures/license +0 -9
- package/dotpi_root/dist/@dotpi/module/node_modules/figures/package.json +0 -49
- package/dotpi_root/dist/@dotpi/module/node_modules/figures/readme.md +0 -337
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/ignore.js +0 -109
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/index.d.ts +0 -207
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/index.js +0 -264
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/license +0 -9
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/@sindresorhus/merge-streams/index.d.ts +0 -44
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/@sindresorhus/merge-streams/index.js +0 -223
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/@sindresorhus/merge-streams/license +0 -9
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/@sindresorhus/merge-streams/package.json +0 -49
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/@sindresorhus/merge-streams/readme.md +0 -53
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/unicorn-magic/default.js +0 -14
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/unicorn-magic/index.d.ts +0 -29
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/unicorn-magic/license +0 -9
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/unicorn-magic/node.js +0 -7
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/unicorn-magic/package.json +0 -49
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/unicorn-magic/readme.md +0 -25
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/package.json +0 -94
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/readme.md +0 -177
- package/dotpi_root/dist/@dotpi/module/node_modules/globby/utilities.js +0 -1
- package/dotpi_root/dist/@dotpi/module/node_modules/human-signals/LICENSE +0 -201
- package/dotpi_root/dist/@dotpi/module/node_modules/human-signals/README.md +0 -180
- package/dotpi_root/dist/@dotpi/module/node_modules/human-signals/build/src/core.js +0 -273
- package/dotpi_root/dist/@dotpi/module/node_modules/human-signals/build/src/main.d.ts +0 -206
- package/dotpi_root/dist/@dotpi/module/node_modules/human-signals/build/src/main.js +0 -70
- package/dotpi_root/dist/@dotpi/module/node_modules/human-signals/build/src/realtime.js +0 -16
- package/dotpi_root/dist/@dotpi/module/node_modules/human-signals/build/src/signals.js +0 -34
- package/dotpi_root/dist/@dotpi/module/node_modules/human-signals/package.json +0 -64
- package/dotpi_root/dist/@dotpi/module/node_modules/is-plain-obj/index.d.ts +0 -35
- package/dotpi_root/dist/@dotpi/module/node_modules/is-plain-obj/index.js +0 -8
- package/dotpi_root/dist/@dotpi/module/node_modules/is-plain-obj/license +0 -9
- package/dotpi_root/dist/@dotpi/module/node_modules/is-plain-obj/package.json +0 -41
- package/dotpi_root/dist/@dotpi/module/node_modules/is-plain-obj/readme.md +0 -58
- package/dotpi_root/dist/@dotpi/module/node_modules/is-unicode-supported/index.d.ts +0 -12
- package/dotpi_root/dist/@dotpi/module/node_modules/is-unicode-supported/index.js +0 -21
- package/dotpi_root/dist/@dotpi/module/node_modules/is-unicode-supported/license +0 -9
- package/dotpi_root/dist/@dotpi/module/node_modules/is-unicode-supported/package.json +0 -47
- package/dotpi_root/dist/@dotpi/module/node_modules/is-unicode-supported/readme.md +0 -35
- package/dotpi_root/dist/@dotpi/module/node_modules/npm-run-path/index.d.ts +0 -90
- package/dotpi_root/dist/@dotpi/module/node_modules/npm-run-path/index.js +0 -55
- package/dotpi_root/dist/@dotpi/module/node_modules/npm-run-path/license +0 -9
- package/dotpi_root/dist/@dotpi/module/node_modules/npm-run-path/package.json +0 -52
- package/dotpi_root/dist/@dotpi/module/node_modules/npm-run-path/readme.md +0 -104
- package/dotpi_root/dist/@dotpi/module/node_modules/path-key/index.d.ts +0 -31
- package/dotpi_root/dist/@dotpi/module/node_modules/path-key/index.js +0 -12
- package/dotpi_root/dist/@dotpi/module/node_modules/path-key/license +0 -9
- package/dotpi_root/dist/@dotpi/module/node_modules/path-key/package.json +0 -41
- package/dotpi_root/dist/@dotpi/module/node_modules/path-key/readme.md +0 -57
- package/dotpi_root/dist/@dotpi/module/node_modules/path-type/index.d.ts +0 -51
- package/dotpi_root/dist/@dotpi/module/node_modules/path-type/index.js +0 -41
- package/dotpi_root/dist/@dotpi/module/node_modules/path-type/license +0 -9
- package/dotpi_root/dist/@dotpi/module/node_modules/path-type/package.json +0 -47
- package/dotpi_root/dist/@dotpi/module/node_modules/path-type/readme.md +0 -74
- package/dotpi_root/dist/@dotpi/module/node_modules/slash/index.d.ts +0 -23
- package/dotpi_root/dist/@dotpi/module/node_modules/slash/index.js +0 -9
- package/dotpi_root/dist/@dotpi/module/node_modules/slash/license +0 -9
- package/dotpi_root/dist/@dotpi/module/node_modules/slash/package.json +0 -39
- package/dotpi_root/dist/@dotpi/module/node_modules/slash/readme.md +0 -36
- package/dotpi_root/dist/@dotpi/module/node_modules/strip-final-newline/index.d.ts +0 -18
- package/dotpi_root/dist/@dotpi/module/node_modules/strip-final-newline/index.js +0 -26
- package/dotpi_root/dist/@dotpi/module/node_modules/strip-final-newline/license +0 -9
- package/dotpi_root/dist/@dotpi/module/node_modules/strip-final-newline/package.json +0 -49
- package/dotpi_root/dist/@dotpi/module/node_modules/strip-final-newline/readme.md +0 -34
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
# npm-run-path
|
|
2
|
-
|
|
3
|
-
> Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries
|
|
4
|
-
|
|
5
|
-
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.
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
|
|
9
|
-
```sh
|
|
10
|
-
npm install npm-run-path
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```js
|
|
16
|
-
import childProcess from 'node:child_process';
|
|
17
|
-
import {npmRunPath, npmRunPathEnv} from 'npm-run-path';
|
|
18
|
-
|
|
19
|
-
console.log(process.env.PATH);
|
|
20
|
-
//=> '/usr/local/bin'
|
|
21
|
-
|
|
22
|
-
console.log(npmRunPath());
|
|
23
|
-
//=> '/Users/sindresorhus/dev/foo/node_modules/.bin:/Users/sindresorhus/dev/node_modules/.bin:/Users/sindresorhus/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/usr/local/bin'
|
|
24
|
-
|
|
25
|
-
// `foo` is a locally installed binary
|
|
26
|
-
childProcess.execFileSync('foo', {
|
|
27
|
-
env: npmRunPathEnv()
|
|
28
|
-
});
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## API
|
|
32
|
-
|
|
33
|
-
### npmRunPath(options?)
|
|
34
|
-
|
|
35
|
-
`options`: [`Options`](#options)\
|
|
36
|
-
_Returns_: `string`
|
|
37
|
-
|
|
38
|
-
Returns the augmented PATH string.
|
|
39
|
-
|
|
40
|
-
### npmRunPathEnv(options?)
|
|
41
|
-
|
|
42
|
-
`options`: [`Options`](#options)\
|
|
43
|
-
_Returns_: `object`
|
|
44
|
-
|
|
45
|
-
Returns the augmented [`process.env`](https://nodejs.org/api/process.html#process_process_env) object.
|
|
46
|
-
|
|
47
|
-
### options
|
|
48
|
-
|
|
49
|
-
Type: `object`
|
|
50
|
-
|
|
51
|
-
#### cwd
|
|
52
|
-
|
|
53
|
-
Type: `string | URL`\
|
|
54
|
-
Default: `process.cwd()`
|
|
55
|
-
|
|
56
|
-
The working directory.
|
|
57
|
-
|
|
58
|
-
#### execPath
|
|
59
|
-
|
|
60
|
-
Type: `string | URL`\
|
|
61
|
-
Default: [`process.execPath`](https://nodejs.org/api/process.html#processexecpath)
|
|
62
|
-
|
|
63
|
-
The path to the current Node.js executable.
|
|
64
|
-
|
|
65
|
-
This can be either an absolute path or a path relative to the [`cwd` option](#cwd).
|
|
66
|
-
|
|
67
|
-
#### addExecPath
|
|
68
|
-
|
|
69
|
-
Type: `boolean`\
|
|
70
|
-
Default: `true`
|
|
71
|
-
|
|
72
|
-
Whether to push the current Node.js executable's directory ([`execPath`](#execpath) option) to the front of PATH.
|
|
73
|
-
|
|
74
|
-
#### preferLocal
|
|
75
|
-
|
|
76
|
-
Type: `boolean`\
|
|
77
|
-
Default: `true`
|
|
78
|
-
|
|
79
|
-
Whether to push the locally installed binaries' directory to the front of PATH.
|
|
80
|
-
|
|
81
|
-
#### path
|
|
82
|
-
|
|
83
|
-
Type: `string`\
|
|
84
|
-
Default: [`PATH`](https://github.com/sindresorhus/path-key)
|
|
85
|
-
|
|
86
|
-
The PATH to be appended.
|
|
87
|
-
|
|
88
|
-
Set it to an empty string to exclude the default PATH.
|
|
89
|
-
|
|
90
|
-
Only available with [`npmRunPath()`](#npmrunpathoptions), not [`npmRunPathEnv()`](#npmrunpathenvoptions).
|
|
91
|
-
|
|
92
|
-
#### env
|
|
93
|
-
|
|
94
|
-
Type: `object`\
|
|
95
|
-
Default: [`process.env`](https://nodejs.org/api/process.html#processenv)
|
|
96
|
-
|
|
97
|
-
Accepts an object of environment variables, like `process.env`, and modifies the PATH using the correct [PATH key](https://github.com/sindresorhus/path-key). Use this if you're modifying the PATH for use in the `child_process` options.
|
|
98
|
-
|
|
99
|
-
Only available with [`npmRunPathEnv()`](#npmrunpathenvoptions), not [`npmRunPath()`](#npmrunpathoptions).
|
|
100
|
-
|
|
101
|
-
## Related
|
|
102
|
-
|
|
103
|
-
- [npm-run-path-cli](https://github.com/sindresorhus/npm-run-path-cli) - CLI for this module
|
|
104
|
-
- [execa](https://github.com/sindresorhus/execa) - Execute a locally installed binary
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export interface Options {
|
|
2
|
-
/**
|
|
3
|
-
Use a custom environment variables object.
|
|
4
|
-
|
|
5
|
-
Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env).
|
|
6
|
-
*/
|
|
7
|
-
readonly env?: Record<string, string | undefined>;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
Get the PATH key for a specific platform.
|
|
11
|
-
|
|
12
|
-
Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform).
|
|
13
|
-
*/
|
|
14
|
-
readonly platform?: NodeJS.Platform;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform.
|
|
19
|
-
|
|
20
|
-
@example
|
|
21
|
-
```
|
|
22
|
-
import pathKey from 'path-key';
|
|
23
|
-
|
|
24
|
-
const key = pathKey();
|
|
25
|
-
//=> 'PATH'
|
|
26
|
-
|
|
27
|
-
const PATH = process.env[key];
|
|
28
|
-
//=> '/usr/local/bin:/usr/bin:/bin'
|
|
29
|
-
```
|
|
30
|
-
*/
|
|
31
|
-
export default function pathKey(options?: Options): string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export default function pathKey(options = {}) {
|
|
2
|
-
const {
|
|
3
|
-
env = process.env,
|
|
4
|
-
platform = process.platform
|
|
5
|
-
} = options;
|
|
6
|
-
|
|
7
|
-
if (platform !== 'win32') {
|
|
8
|
-
return 'PATH';
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
return Object.keys(env).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';
|
|
12
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
-
|
|
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:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
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.
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "path-key",
|
|
3
|
-
"version": "4.0.0",
|
|
4
|
-
"description": "Get the PATH environment variable key cross-platform",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "sindresorhus/path-key",
|
|
7
|
-
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
-
"author": {
|
|
9
|
-
"name": "Sindre Sorhus",
|
|
10
|
-
"email": "sindresorhus@gmail.com",
|
|
11
|
-
"url": "https://sindresorhus.com"
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"exports": "./index.js",
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=12"
|
|
17
|
-
},
|
|
18
|
-
"scripts": {
|
|
19
|
-
"test": "xo && ava && tsd"
|
|
20
|
-
},
|
|
21
|
-
"files": [
|
|
22
|
-
"index.js",
|
|
23
|
-
"index.d.ts"
|
|
24
|
-
],
|
|
25
|
-
"keywords": [
|
|
26
|
-
"path",
|
|
27
|
-
"key",
|
|
28
|
-
"environment",
|
|
29
|
-
"env",
|
|
30
|
-
"variable",
|
|
31
|
-
"get",
|
|
32
|
-
"cross-platform",
|
|
33
|
-
"windows"
|
|
34
|
-
],
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@types/node": "^14.14.37",
|
|
37
|
-
"ava": "^3.15.0",
|
|
38
|
-
"tsd": "^0.14.0",
|
|
39
|
-
"xo": "^0.38.2"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# path-key
|
|
2
|
-
|
|
3
|
-
> Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform
|
|
4
|
-
|
|
5
|
-
It's usually `PATH` but on Windows it can be any casing like `Path`...
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
$ npm install path-key
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```js
|
|
16
|
-
import pathKey from 'path-key';
|
|
17
|
-
|
|
18
|
-
const key = pathKey();
|
|
19
|
-
//=> 'PATH'
|
|
20
|
-
|
|
21
|
-
const PATH = process.env[key];
|
|
22
|
-
//=> '/usr/local/bin:/usr/bin:/bin'
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## API
|
|
26
|
-
|
|
27
|
-
### pathKey(options?)
|
|
28
|
-
|
|
29
|
-
#### options
|
|
30
|
-
|
|
31
|
-
Type: `object`
|
|
32
|
-
|
|
33
|
-
##### env
|
|
34
|
-
|
|
35
|
-
Type: `object`\
|
|
36
|
-
Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env)
|
|
37
|
-
|
|
38
|
-
Use a custom environment variables object.
|
|
39
|
-
|
|
40
|
-
#### platform
|
|
41
|
-
|
|
42
|
-
Type: `string`\
|
|
43
|
-
Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform)
|
|
44
|
-
|
|
45
|
-
Get the PATH key for a specific platform.
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
<div align="center">
|
|
50
|
-
<b>
|
|
51
|
-
<a href="https://tidelift.com/subscription/pkg/npm-path-key?utm_source=npm-path-key&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
|
52
|
-
</b>
|
|
53
|
-
<br>
|
|
54
|
-
<sub>
|
|
55
|
-
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
|
56
|
-
</sub>
|
|
57
|
-
</div>
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
export type PathTypeFunction = (path: string) => Promise<boolean>;
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
Check whether the passed `path` is a file.
|
|
5
|
-
|
|
6
|
-
@param path - The path to check.
|
|
7
|
-
@returns Whether the `path` is a file.
|
|
8
|
-
*/
|
|
9
|
-
export const isFile: PathTypeFunction;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
Check whether the passed `path` is a directory.
|
|
13
|
-
|
|
14
|
-
@param path - The path to check.
|
|
15
|
-
@returns Whether the `path` is a directory.
|
|
16
|
-
*/
|
|
17
|
-
export const isDirectory: PathTypeFunction;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
Check whether the passed `path` is a symlink.
|
|
21
|
-
|
|
22
|
-
@param path - The path to check.
|
|
23
|
-
@returns Whether the `path` is a symlink.
|
|
24
|
-
*/
|
|
25
|
-
export const isSymlink: PathTypeFunction;
|
|
26
|
-
|
|
27
|
-
export type PathTypeSyncFunction = (path: string) => boolean;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
Synchronously check whether the passed `path` is a file.
|
|
31
|
-
|
|
32
|
-
@param path - The path to check.
|
|
33
|
-
@returns Whether the `path` is a file.
|
|
34
|
-
*/
|
|
35
|
-
export const isFileSync: PathTypeSyncFunction;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
Synchronously check whether the passed `path` is a directory.
|
|
39
|
-
|
|
40
|
-
@param path - The path to check.
|
|
41
|
-
@returns Whether the `path` is a directory.
|
|
42
|
-
*/
|
|
43
|
-
export const isDirectorySync: PathTypeSyncFunction;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
Synchronously check whether the passed `path` is a symlink.
|
|
47
|
-
|
|
48
|
-
@param path - The path to check.
|
|
49
|
-
@returns Whether the `path` is a directory.
|
|
50
|
-
*/
|
|
51
|
-
export const isSymlinkSync: PathTypeSyncFunction;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import fs, {promises as fsPromises} from 'fs';
|
|
2
|
-
|
|
3
|
-
async function isType(fsStatType, statsMethodName, filePath) {
|
|
4
|
-
if (typeof filePath !== 'string') {
|
|
5
|
-
throw new TypeError(`Expected a string, got ${typeof filePath}`);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
try {
|
|
9
|
-
const stats = await fsPromises[fsStatType](filePath);
|
|
10
|
-
return stats[statsMethodName]();
|
|
11
|
-
} catch (error) {
|
|
12
|
-
if (error.code === 'ENOENT') {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
throw error;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function isTypeSync(fsStatType, statsMethodName, filePath) {
|
|
21
|
-
if (typeof filePath !== 'string') {
|
|
22
|
-
throw new TypeError(`Expected a string, got ${typeof filePath}`);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
try {
|
|
26
|
-
return fs[fsStatType](filePath)[statsMethodName]();
|
|
27
|
-
} catch (error) {
|
|
28
|
-
if (error.code === 'ENOENT') {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
throw error;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export const isFile = isType.bind(null, 'stat', 'isFile');
|
|
37
|
-
export const isDirectory = isType.bind(null, 'stat', 'isDirectory');
|
|
38
|
-
export const isSymlink = isType.bind(null, 'lstat', 'isSymbolicLink');
|
|
39
|
-
export const isFileSync = isTypeSync.bind(null, 'statSync', 'isFile');
|
|
40
|
-
export const isDirectorySync = isTypeSync.bind(null, 'statSync', 'isDirectory');
|
|
41
|
-
export const isSymlinkSync = isTypeSync.bind(null, 'lstatSync', 'isSymbolicLink');
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
-
|
|
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:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
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.
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "path-type",
|
|
3
|
-
"version": "5.0.0",
|
|
4
|
-
"description": "Check if a path is a file, directory, or symlink",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "sindresorhus/path-type",
|
|
7
|
-
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
-
"author": {
|
|
9
|
-
"name": "Sindre Sorhus",
|
|
10
|
-
"email": "sindresorhus@gmail.com",
|
|
11
|
-
"url": "https://sindresorhus.com"
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"exports": "./index.js",
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=12"
|
|
17
|
-
},
|
|
18
|
-
"scripts": {
|
|
19
|
-
"test": "xo && nyc ava && tsd"
|
|
20
|
-
},
|
|
21
|
-
"files": [
|
|
22
|
-
"index.js",
|
|
23
|
-
"index.d.ts"
|
|
24
|
-
],
|
|
25
|
-
"keywords": [
|
|
26
|
-
"path",
|
|
27
|
-
"fs",
|
|
28
|
-
"type",
|
|
29
|
-
"is",
|
|
30
|
-
"check",
|
|
31
|
-
"directory",
|
|
32
|
-
"file",
|
|
33
|
-
"filepath",
|
|
34
|
-
"symlink",
|
|
35
|
-
"symbolic",
|
|
36
|
-
"link",
|
|
37
|
-
"stat",
|
|
38
|
-
"stats",
|
|
39
|
-
"filesystem"
|
|
40
|
-
],
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"ava": "^3.15.0",
|
|
43
|
-
"nyc": "^15.1.0",
|
|
44
|
-
"tsd": "^0.14.0",
|
|
45
|
-
"xo": "^0.37.1"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# path-type
|
|
2
|
-
|
|
3
|
-
> Check if a path is a file, directory, or symlink
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
$ npm install path-type
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
import {isFile} from 'path-type';
|
|
15
|
-
|
|
16
|
-
console.log(await isFile('package.json'));
|
|
17
|
-
//=> true
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## API
|
|
21
|
-
|
|
22
|
-
### isFile(path)
|
|
23
|
-
|
|
24
|
-
Check whether the passed `path` is a file.
|
|
25
|
-
|
|
26
|
-
Returns a `Promise<boolean>`.
|
|
27
|
-
|
|
28
|
-
#### path
|
|
29
|
-
|
|
30
|
-
Type: `string`
|
|
31
|
-
|
|
32
|
-
The path to check.
|
|
33
|
-
|
|
34
|
-
### isDirectory(path)
|
|
35
|
-
|
|
36
|
-
Check whether the passed `path` is a directory.
|
|
37
|
-
|
|
38
|
-
Returns a `Promise<boolean>`.
|
|
39
|
-
|
|
40
|
-
### isSymlink(path)
|
|
41
|
-
|
|
42
|
-
Check whether the passed `path` is a symlink.
|
|
43
|
-
|
|
44
|
-
Returns a `Promise<boolean>`.
|
|
45
|
-
|
|
46
|
-
### isFileSync(path)
|
|
47
|
-
|
|
48
|
-
Synchronously check whether the passed `path` is a file.
|
|
49
|
-
|
|
50
|
-
Returns a `boolean`.
|
|
51
|
-
|
|
52
|
-
### isDirectorySync(path)
|
|
53
|
-
|
|
54
|
-
Synchronously check whether the passed `path` is a directory.
|
|
55
|
-
|
|
56
|
-
Returns a `boolean`.
|
|
57
|
-
|
|
58
|
-
### isSymlinkSync(path)
|
|
59
|
-
|
|
60
|
-
Synchronously check whether the passed `path` is a symlink.
|
|
61
|
-
|
|
62
|
-
Returns a `boolean`.
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
<div align="center">
|
|
67
|
-
<b>
|
|
68
|
-
<a href="https://tidelift.com/subscription/pkg/npm-path-type?utm_source=npm-path-type&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
|
69
|
-
</b>
|
|
70
|
-
<br>
|
|
71
|
-
<sub>
|
|
72
|
-
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
|
73
|
-
</sub>
|
|
74
|
-
</div>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Convert Windows backslash paths to slash paths: `foo\\bar` ➔ `foo/bar`.
|
|
3
|
-
|
|
4
|
-
[Forward-slash paths can be used in Windows](http://superuser.com/a/176395/6877) as long as they're not extended-length paths.
|
|
5
|
-
|
|
6
|
-
@param path - A Windows backslash path.
|
|
7
|
-
@returns A path with forward slashes.
|
|
8
|
-
|
|
9
|
-
@example
|
|
10
|
-
```
|
|
11
|
-
import path from 'node:path';
|
|
12
|
-
import slash from 'slash';
|
|
13
|
-
|
|
14
|
-
const string = path.join('foo', 'bar');
|
|
15
|
-
// Unix => foo/bar
|
|
16
|
-
// Windows => foo\\bar
|
|
17
|
-
|
|
18
|
-
slash(string);
|
|
19
|
-
// Unix => foo/bar
|
|
20
|
-
// Windows => foo/bar
|
|
21
|
-
```
|
|
22
|
-
*/
|
|
23
|
-
export default function slash(path: string): string;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
-
|
|
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:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
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.
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "slash",
|
|
3
|
-
"version": "5.1.0",
|
|
4
|
-
"description": "Convert Windows backslash paths to slash paths",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "sindresorhus/slash",
|
|
7
|
-
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
-
"author": {
|
|
9
|
-
"name": "Sindre Sorhus",
|
|
10
|
-
"email": "sindresorhus@gmail.com",
|
|
11
|
-
"url": "https://sindresorhus.com"
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"exports": "./index.js",
|
|
15
|
-
"types": "./index.d.ts",
|
|
16
|
-
"engines": {
|
|
17
|
-
"node": ">=14.16"
|
|
18
|
-
},
|
|
19
|
-
"scripts": {
|
|
20
|
-
"test": "xo && ava && tsd"
|
|
21
|
-
},
|
|
22
|
-
"files": [
|
|
23
|
-
"index.js",
|
|
24
|
-
"index.d.ts"
|
|
25
|
-
],
|
|
26
|
-
"keywords": [
|
|
27
|
-
"path",
|
|
28
|
-
"seperator",
|
|
29
|
-
"slash",
|
|
30
|
-
"backslash",
|
|
31
|
-
"windows",
|
|
32
|
-
"convert"
|
|
33
|
-
],
|
|
34
|
-
"devDependencies": {
|
|
35
|
-
"ava": "^5.2.0",
|
|
36
|
-
"tsd": "^0.28.1",
|
|
37
|
-
"xo": "^0.54.2"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# slash
|
|
2
|
-
|
|
3
|
-
> Convert Windows backslash paths to slash paths: `foo\\bar` ➔ `foo/bar`
|
|
4
|
-
|
|
5
|
-
[Forward-slash paths can be used in Windows](http://superuser.com/a/176395/6877) as long as they're not extended-length paths.
|
|
6
|
-
|
|
7
|
-
This was created since the `path` methods in Node.js outputs `\\` paths on Windows.
|
|
8
|
-
|
|
9
|
-
## Install
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
npm install slash
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
16
|
-
|
|
17
|
-
```js
|
|
18
|
-
import path from 'node:path';
|
|
19
|
-
import slash from 'slash';
|
|
20
|
-
|
|
21
|
-
const string = path.join('foo', 'bar');
|
|
22
|
-
// Unix => foo/bar
|
|
23
|
-
// Windows => foo\\bar
|
|
24
|
-
|
|
25
|
-
slash(string);
|
|
26
|
-
// Unix => foo/bar
|
|
27
|
-
// Windows => foo/bar
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## API
|
|
31
|
-
|
|
32
|
-
### slash(path)
|
|
33
|
-
|
|
34
|
-
Type: `string`
|
|
35
|
-
|
|
36
|
-
Accepts a Windows backslash path and returns a path with forward slashes.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
Strip the final [newline character](https://en.wikipedia.org/wiki/Newline) from a string or Uint8Array.
|
|
3
|
-
|
|
4
|
-
@returns The input without any final newline.
|
|
5
|
-
|
|
6
|
-
@example
|
|
7
|
-
```
|
|
8
|
-
import stripFinalNewline from 'strip-final-newline';
|
|
9
|
-
|
|
10
|
-
stripFinalNewline('foo\nbar\n\n');
|
|
11
|
-
//=> 'foo\nbar\n'
|
|
12
|
-
|
|
13
|
-
const uint8Array = new TextEncoder().encode('foo\nbar\n\n')
|
|
14
|
-
new TextDecoder().decode(stripFinalNewline(uint8Array));
|
|
15
|
-
//=> 'foo\nbar\n'
|
|
16
|
-
```
|
|
17
|
-
*/
|
|
18
|
-
export default function stripFinalNewline<T extends string | Uint8Array>(input: T): T;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default function stripFinalNewline(input) {
|
|
2
|
-
if (typeof input === 'string') {
|
|
3
|
-
return stripFinalNewlineString(input);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
if (!(ArrayBuffer.isView(input) && input.BYTES_PER_ELEMENT === 1)) {
|
|
7
|
-
throw new Error('Input must be a string or a Uint8Array');
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
return stripFinalNewlineBinary(input);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const stripFinalNewlineString = input =>
|
|
14
|
-
input.at(-1) === LF
|
|
15
|
-
? input.slice(0, input.at(-2) === CR ? -2 : -1)
|
|
16
|
-
: input;
|
|
17
|
-
|
|
18
|
-
const stripFinalNewlineBinary = input =>
|
|
19
|
-
input.at(-1) === LF_BINARY
|
|
20
|
-
? input.subarray(0, input.at(-2) === CR_BINARY ? -2 : -1)
|
|
21
|
-
: input;
|
|
22
|
-
|
|
23
|
-
const LF = '\n';
|
|
24
|
-
const LF_BINARY = LF.codePointAt(0);
|
|
25
|
-
const CR = '\r';
|
|
26
|
-
const CR_BINARY = CR.codePointAt(0);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
-
|
|
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:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
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.
|