@zkochan/cmd-shim 3.0.1 → 3.1.0

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 (3) hide show
  1. package/index.d.ts +47 -0
  2. package/index.js +2 -2
  3. package/package.json +3 -1
package/index.d.ts ADDED
@@ -0,0 +1,47 @@
1
+
2
+ interface Options {
3
+ /**
4
+ * If a PowerShell script should be created.
5
+ *
6
+ * @default true
7
+ */
8
+ createPwshFile?: boolean;
9
+
10
+ /**
11
+ * If a Windows Command Prompt script should be created.
12
+ *
13
+ * @default false
14
+ */
15
+ createCmdFile?: boolean;
16
+
17
+ /**
18
+ * If symbolic links should be preserved.
19
+ *
20
+ * @default false
21
+ */
22
+ preserveSymlinks?: boolean;
23
+
24
+ /**
25
+ * The path to the executable file.
26
+ */
27
+ prog?: string;
28
+
29
+ /**
30
+ * The arguments to initialize the `node` process with.
31
+ */
32
+ args?: string;
33
+
34
+ /**
35
+ * The value of the $NODE_PATH environment variable.
36
+ *
37
+ * The single `string` format is only kept for legacy compatibility,
38
+ * and the array form should be preferred.
39
+ */
40
+ nodePath?: string | string[];
41
+ }
42
+
43
+ declare function cmdShim(src: string, to: string, opts: Options): Promise<void>
44
+ declare namespace cmdShim {
45
+ function cmdShimIfExists(src: string, to: string, opts: Options): Promise<void>
46
+ }
47
+ export = cmdShim;
package/index.js CHANGED
@@ -241,7 +241,7 @@ function chmodShim (to, {createCmdFile, createPwshFile}) {
241
241
  }
242
242
 
243
243
  /**
244
- * @param {string} nodePath
244
+ * @param {string|string[]} nodePath
245
245
  * @returns {{win32:string,posix:string}}
246
246
  */
247
247
  function normalizePathEnvVar (nodePath) {
@@ -251,7 +251,7 @@ function normalizePathEnvVar (nodePath) {
251
251
  posix: nodePath
252
252
  }
253
253
  }
254
- let split = (typeof nodePath === 'string' ? String(nodePath).split(path.delimiter) : Array.from(nodePath))
254
+ let split = (typeof nodePath === 'string' ? nodePath.split(path.delimiter) : Array.from(nodePath))
255
255
  let result = {}
256
256
  for (let i = 0; i < split.length; i++) {
257
257
  const win32 = split[i].split('/').join('\\')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zkochan/cmd-shim",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "Used in pnpm for command line application support",
5
5
  "author": {
6
6
  "name": "Zoltan Kochan",
@@ -13,8 +13,10 @@
13
13
  "md": "mos"
14
14
  },
15
15
  "files": [
16
+ "index.d.ts",
16
17
  "index.js"
17
18
  ],
19
+ "types": "index.d.ts",
18
20
  "repository": {
19
21
  "type": "git",
20
22
  "url": "https://github.com/pnpm/cmd-shim.git"