@dotpi/tools 2.9.2 → 2.9.5

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.
Files changed (110) hide show
  1. package/dotpi_root/bin/dotpi_prepare_system +8 -0
  2. package/dotpi_root/dist/@dotpi/avahi-monitor-module/package.json +1 -1
  3. package/dotpi_root/dist/@dotpi/javascript/package.json +1 -1
  4. package/dotpi_root/dist/@dotpi/module/package.json +2 -2
  5. package/dotpi_root/dist/@dotpi/module-module/package.json +3 -3
  6. package/package.json +5 -5
  7. package/dotpi_root/dist/@dotpi/javascript/node_modules/figures/index.d.ts +0 -279
  8. package/dotpi_root/dist/@dotpi/javascript/node_modules/figures/index.js +0 -292
  9. package/dotpi_root/dist/@dotpi/javascript/node_modules/figures/license +0 -9
  10. package/dotpi_root/dist/@dotpi/javascript/node_modules/figures/package.json +0 -49
  11. package/dotpi_root/dist/@dotpi/javascript/node_modules/figures/readme.md +0 -337
  12. package/dotpi_root/dist/@dotpi/javascript/node_modules/human-signals/LICENSE +0 -201
  13. package/dotpi_root/dist/@dotpi/javascript/node_modules/human-signals/README.md +0 -180
  14. package/dotpi_root/dist/@dotpi/javascript/node_modules/human-signals/build/src/core.js +0 -273
  15. package/dotpi_root/dist/@dotpi/javascript/node_modules/human-signals/build/src/main.d.ts +0 -206
  16. package/dotpi_root/dist/@dotpi/javascript/node_modules/human-signals/build/src/main.js +0 -70
  17. package/dotpi_root/dist/@dotpi/javascript/node_modules/human-signals/build/src/realtime.js +0 -16
  18. package/dotpi_root/dist/@dotpi/javascript/node_modules/human-signals/build/src/signals.js +0 -34
  19. package/dotpi_root/dist/@dotpi/javascript/node_modules/human-signals/package.json +0 -64
  20. package/dotpi_root/dist/@dotpi/javascript/node_modules/is-plain-obj/index.d.ts +0 -35
  21. package/dotpi_root/dist/@dotpi/javascript/node_modules/is-plain-obj/index.js +0 -8
  22. package/dotpi_root/dist/@dotpi/javascript/node_modules/is-plain-obj/license +0 -9
  23. package/dotpi_root/dist/@dotpi/javascript/node_modules/is-plain-obj/package.json +0 -41
  24. package/dotpi_root/dist/@dotpi/javascript/node_modules/is-plain-obj/readme.md +0 -58
  25. package/dotpi_root/dist/@dotpi/javascript/node_modules/is-unicode-supported/index.d.ts +0 -12
  26. package/dotpi_root/dist/@dotpi/javascript/node_modules/is-unicode-supported/index.js +0 -21
  27. package/dotpi_root/dist/@dotpi/javascript/node_modules/is-unicode-supported/license +0 -9
  28. package/dotpi_root/dist/@dotpi/javascript/node_modules/is-unicode-supported/package.json +0 -47
  29. package/dotpi_root/dist/@dotpi/javascript/node_modules/is-unicode-supported/readme.md +0 -35
  30. package/dotpi_root/dist/@dotpi/javascript/node_modules/npm-run-path/index.d.ts +0 -90
  31. package/dotpi_root/dist/@dotpi/javascript/node_modules/npm-run-path/index.js +0 -55
  32. package/dotpi_root/dist/@dotpi/javascript/node_modules/npm-run-path/license +0 -9
  33. package/dotpi_root/dist/@dotpi/javascript/node_modules/npm-run-path/package.json +0 -52
  34. package/dotpi_root/dist/@dotpi/javascript/node_modules/npm-run-path/readme.md +0 -104
  35. package/dotpi_root/dist/@dotpi/javascript/node_modules/path-key/index.d.ts +0 -31
  36. package/dotpi_root/dist/@dotpi/javascript/node_modules/path-key/index.js +0 -12
  37. package/dotpi_root/dist/@dotpi/javascript/node_modules/path-key/license +0 -9
  38. package/dotpi_root/dist/@dotpi/javascript/node_modules/path-key/package.json +0 -41
  39. package/dotpi_root/dist/@dotpi/javascript/node_modules/path-key/readme.md +0 -57
  40. package/dotpi_root/dist/@dotpi/javascript/node_modules/strip-final-newline/index.d.ts +0 -18
  41. package/dotpi_root/dist/@dotpi/javascript/node_modules/strip-final-newline/index.js +0 -26
  42. package/dotpi_root/dist/@dotpi/javascript/node_modules/strip-final-newline/license +0 -9
  43. package/dotpi_root/dist/@dotpi/javascript/node_modules/strip-final-newline/package.json +0 -49
  44. package/dotpi_root/dist/@dotpi/javascript/node_modules/strip-final-newline/readme.md +0 -34
  45. package/dotpi_root/dist/@dotpi/module/node_modules/figures/index.d.ts +0 -279
  46. package/dotpi_root/dist/@dotpi/module/node_modules/figures/index.js +0 -292
  47. package/dotpi_root/dist/@dotpi/module/node_modules/figures/license +0 -9
  48. package/dotpi_root/dist/@dotpi/module/node_modules/figures/package.json +0 -49
  49. package/dotpi_root/dist/@dotpi/module/node_modules/figures/readme.md +0 -337
  50. package/dotpi_root/dist/@dotpi/module/node_modules/globby/ignore.js +0 -109
  51. package/dotpi_root/dist/@dotpi/module/node_modules/globby/index.d.ts +0 -207
  52. package/dotpi_root/dist/@dotpi/module/node_modules/globby/index.js +0 -264
  53. package/dotpi_root/dist/@dotpi/module/node_modules/globby/license +0 -9
  54. package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/@sindresorhus/merge-streams/index.d.ts +0 -44
  55. package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/@sindresorhus/merge-streams/index.js +0 -223
  56. package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/@sindresorhus/merge-streams/license +0 -9
  57. package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/@sindresorhus/merge-streams/package.json +0 -49
  58. package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/@sindresorhus/merge-streams/readme.md +0 -53
  59. package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/unicorn-magic/default.js +0 -14
  60. package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/unicorn-magic/index.d.ts +0 -29
  61. package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/unicorn-magic/license +0 -9
  62. package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/unicorn-magic/node.js +0 -7
  63. package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/unicorn-magic/package.json +0 -49
  64. package/dotpi_root/dist/@dotpi/module/node_modules/globby/node_modules/unicorn-magic/readme.md +0 -25
  65. package/dotpi_root/dist/@dotpi/module/node_modules/globby/package.json +0 -94
  66. package/dotpi_root/dist/@dotpi/module/node_modules/globby/readme.md +0 -177
  67. package/dotpi_root/dist/@dotpi/module/node_modules/globby/utilities.js +0 -1
  68. package/dotpi_root/dist/@dotpi/module/node_modules/human-signals/LICENSE +0 -201
  69. package/dotpi_root/dist/@dotpi/module/node_modules/human-signals/README.md +0 -180
  70. package/dotpi_root/dist/@dotpi/module/node_modules/human-signals/build/src/core.js +0 -273
  71. package/dotpi_root/dist/@dotpi/module/node_modules/human-signals/build/src/main.d.ts +0 -206
  72. package/dotpi_root/dist/@dotpi/module/node_modules/human-signals/build/src/main.js +0 -70
  73. package/dotpi_root/dist/@dotpi/module/node_modules/human-signals/build/src/realtime.js +0 -16
  74. package/dotpi_root/dist/@dotpi/module/node_modules/human-signals/build/src/signals.js +0 -34
  75. package/dotpi_root/dist/@dotpi/module/node_modules/human-signals/package.json +0 -64
  76. package/dotpi_root/dist/@dotpi/module/node_modules/is-plain-obj/index.d.ts +0 -35
  77. package/dotpi_root/dist/@dotpi/module/node_modules/is-plain-obj/index.js +0 -8
  78. package/dotpi_root/dist/@dotpi/module/node_modules/is-plain-obj/license +0 -9
  79. package/dotpi_root/dist/@dotpi/module/node_modules/is-plain-obj/package.json +0 -41
  80. package/dotpi_root/dist/@dotpi/module/node_modules/is-plain-obj/readme.md +0 -58
  81. package/dotpi_root/dist/@dotpi/module/node_modules/is-unicode-supported/index.d.ts +0 -12
  82. package/dotpi_root/dist/@dotpi/module/node_modules/is-unicode-supported/index.js +0 -21
  83. package/dotpi_root/dist/@dotpi/module/node_modules/is-unicode-supported/license +0 -9
  84. package/dotpi_root/dist/@dotpi/module/node_modules/is-unicode-supported/package.json +0 -47
  85. package/dotpi_root/dist/@dotpi/module/node_modules/is-unicode-supported/readme.md +0 -35
  86. package/dotpi_root/dist/@dotpi/module/node_modules/npm-run-path/index.d.ts +0 -90
  87. package/dotpi_root/dist/@dotpi/module/node_modules/npm-run-path/index.js +0 -55
  88. package/dotpi_root/dist/@dotpi/module/node_modules/npm-run-path/license +0 -9
  89. package/dotpi_root/dist/@dotpi/module/node_modules/npm-run-path/package.json +0 -52
  90. package/dotpi_root/dist/@dotpi/module/node_modules/npm-run-path/readme.md +0 -104
  91. package/dotpi_root/dist/@dotpi/module/node_modules/path-key/index.d.ts +0 -31
  92. package/dotpi_root/dist/@dotpi/module/node_modules/path-key/index.js +0 -12
  93. package/dotpi_root/dist/@dotpi/module/node_modules/path-key/license +0 -9
  94. package/dotpi_root/dist/@dotpi/module/node_modules/path-key/package.json +0 -41
  95. package/dotpi_root/dist/@dotpi/module/node_modules/path-key/readme.md +0 -57
  96. package/dotpi_root/dist/@dotpi/module/node_modules/path-type/index.d.ts +0 -51
  97. package/dotpi_root/dist/@dotpi/module/node_modules/path-type/index.js +0 -41
  98. package/dotpi_root/dist/@dotpi/module/node_modules/path-type/license +0 -9
  99. package/dotpi_root/dist/@dotpi/module/node_modules/path-type/package.json +0 -47
  100. package/dotpi_root/dist/@dotpi/module/node_modules/path-type/readme.md +0 -74
  101. package/dotpi_root/dist/@dotpi/module/node_modules/slash/index.d.ts +0 -23
  102. package/dotpi_root/dist/@dotpi/module/node_modules/slash/index.js +0 -9
  103. package/dotpi_root/dist/@dotpi/module/node_modules/slash/license +0 -9
  104. package/dotpi_root/dist/@dotpi/module/node_modules/slash/package.json +0 -39
  105. package/dotpi_root/dist/@dotpi/module/node_modules/slash/readme.md +0 -36
  106. package/dotpi_root/dist/@dotpi/module/node_modules/strip-final-newline/index.d.ts +0 -18
  107. package/dotpi_root/dist/@dotpi/module/node_modules/strip-final-newline/index.js +0 -26
  108. package/dotpi_root/dist/@dotpi/module/node_modules/strip-final-newline/license +0 -9
  109. package/dotpi_root/dist/@dotpi/module/node_modules/strip-final-newline/package.json +0 -49
  110. package/dotpi_root/dist/@dotpi/module/node_modules/strip-final-newline/readme.md +0 -34
@@ -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
- export default function slash(path) {
2
- const isExtendedLengthPath = path.startsWith('\\\\?\\');
3
-
4
- if (isExtendedLengthPath) {
5
- return path;
6
- }
7
-
8
- return path.replace(/\\/g, '/');
9
- }
@@ -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.
@@ -1,49 +0,0 @@
1
- {
2
- "name": "strip-final-newline",
3
- "version": "4.0.0",
4
- "description": "Strip the final newline character from a string or Uint8Array",
5
- "license": "MIT",
6
- "repository": "sindresorhus/strip-final-newline",
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": {
15
- "types": "./index.d.ts",
16
- "default": "./index.js"
17
- },
18
- "sideEffects": false,
19
- "engines": {
20
- "node": ">=18"
21
- },
22
- "scripts": {
23
- "test": "xo && ava && tsd"
24
- },
25
- "files": [
26
- "index.js",
27
- "index.d.ts"
28
- ],
29
- "keywords": [
30
- "strip",
31
- "trim",
32
- "remove",
33
- "delete",
34
- "final",
35
- "last",
36
- "end",
37
- "file",
38
- "newline",
39
- "linebreak",
40
- "character",
41
- "string",
42
- "uint8array"
43
- ],
44
- "devDependencies": {
45
- "ava": "^6.0.1",
46
- "tsd": "^0.29.0",
47
- "xo": "^0.56.0"
48
- }
49
- }
@@ -1,34 +0,0 @@
1
- # strip-final-newline
2
-
3
- > Strip the final [newline character](https://en.wikipedia.org/wiki/Newline) from a string or Uint8Array.
4
-
5
- This can be useful when parsing the output of, for example, `ChildProcess#execFile()`, as [binaries usually output a newline at the end](https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline). You cannot use `stdout.trimEnd()` for this as it removes all trailing newlines and whitespaces at the end.
6
-
7
- ## Install
8
-
9
- ```sh
10
- npm install strip-final-newline
11
- ```
12
-
13
- ## Usage
14
-
15
- ```js
16
- import stripFinalNewline from 'strip-final-newline';
17
-
18
- stripFinalNewline('foo\nbar\n\n');
19
- //=> 'foo\nbar\n'
20
-
21
- const uint8Array = new TextEncoder().encode('foo\nbar\n\n')
22
- new TextDecoder().decode(stripFinalNewline(uint8Array));
23
- //=> 'foo\nbar\n'
24
- ```
25
-
26
- ## Performance
27
-
28
- When using an `Uint8Array`, the original value is referenced, not copied. This is much more efficient, requires almost no memory, and remains milliseconds fast even on very large inputs.
29
-
30
- If you'd like to ensure that modifying the return value does not also modify the value passed as input, please use `.slice()`.
31
-
32
- ```js
33
- const value = new TextDecoder().decode(stripFinalNewline(uint8Array).slice());
34
- ```