install-module-linked-compat 0.2.1 → 0.2.3
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/README.md +13 -5
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -8
package/README.md
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
# install-module-linked-compat
|
|
2
2
|
|
|
3
3
|
Installs and symlinks a module into node_modules
|
|
4
4
|
|
|
5
5
|
This is the broad-Node version of install-module-linked (engines >= 0.8): it re-exports the identical API and injects shims only for the built-ins the running Node lacks. On Node >= 18 it is a pure pass-through to install-module-linked.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```sh
|
|
8
|
+
npm install install-module-linked-compat
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
For older CommonJS applications:
|
|
8
12
|
|
|
9
|
-
```
|
|
10
|
-
|
|
13
|
+
```js
|
|
14
|
+
var path = require('path');
|
|
15
|
+
var installModule = require('install-module-linked-compat');
|
|
11
16
|
|
|
12
|
-
|
|
17
|
+
installModule('is-number@7.0.0', path.join(__dirname, 'node_modules'), function (err, installedAt) {
|
|
18
|
+
if (err) throw err;
|
|
19
|
+
console.log(installedAt);
|
|
20
|
+
});
|
|
13
21
|
```
|
|
14
22
|
|
|
15
23
|
### Documentation
|
package/dist/cjs/index.js
CHANGED
|
@@ -102,6 +102,8 @@ function clear(options) {
|
|
|
102
102
|
(0, _installmodulelinked.clear)(_object_spread({}, _compatts.default, options));
|
|
103
103
|
}
|
|
104
104
|
function install(specifier, dest, options, callback) {
|
|
105
|
+
callback = typeof options === 'function' ? options : callback;
|
|
106
|
+
options = typeof options === 'function' ? {} : options || {};
|
|
105
107
|
(0, _installmodulelinked.install)(specifier, dest, _object_spread({}, _compatts.default, options), callback);
|
|
106
108
|
}
|
|
107
109
|
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/install-module-linked-compat/src/index.ts"],"sourcesContent":["import type { CleanOptions, InstallCallback, InstallOptions } from 'install-module-linked';\nimport installModuleCore, { clear as clearCore, install as installCore, parseInstallString, sync as syncCore } from 'install-module-linked';\nimport overlay from './compat.ts';\n\nexport type * from 'install-module-linked';\n\n// Identical API to install-module-linked; the overlay supplies the shims the\n// running node lacks (empty on Node >= 18), and user options always win.\n\nexport default function installModule(installString: string, nodeModulesPath: string, callback: InstallCallback): void;\nexport default function installModule(installString: string, nodeModulesPath: string, options: InstallOptions, callback: InstallCallback): void;\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions): Promise<string>;\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions | InstallCallback, callback?: InstallCallback): void | Promise<string> {\n const userOptions = typeof options === 'function' ? {} : options || {};\n const userCallback = typeof options === 'function' ? options : callback;\n const merged = { ...overlay, ...userOptions };\n if (typeof userCallback === 'function') return installModuleCore(installString, nodeModulesPath, merged, userCallback);\n return installModuleCore(installString, nodeModulesPath, merged);\n}\n\nexport function sync(installString: string, nodeModulesPath: string, options?: InstallOptions): string | undefined {\n return syncCore(installString, nodeModulesPath, { ...overlay, ...options });\n}\n\nexport function clear(options?: CleanOptions): void {\n clearCore({ ...overlay, ...options });\n}\n\nexport function install(specifier: string, dest: string, options: InstallOptions, callback: InstallCallback): void {\n installCore(specifier, dest, { ...overlay, ...options }, callback);\n}\n\nexport { parseInstallString };\n"],"names":["clear","installModule","install","parseInstallString","sync","installString","nodeModulesPath","options","callback","userOptions","userCallback","merged","overlay","installModuleCore","syncCore","clearCore","specifier","dest","installCore"],"mappings":";;;;;;;;;;;QAwBgBA;eAAAA;;QAZhB;eAAwBC;;
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/install-module-linked-compat/src/index.ts"],"sourcesContent":["import type { CleanOptions, InstallCallback, InstallOptions } from 'install-module-linked';\nimport installModuleCore, { clear as clearCore, install as installCore, parseInstallString, sync as syncCore } from 'install-module-linked';\nimport overlay from './compat.ts';\n\nexport type * from 'install-module-linked';\n\n// Identical API to install-module-linked; the overlay supplies the shims the\n// running node lacks (empty on Node >= 18), and user options always win.\n\nexport default function installModule(installString: string, nodeModulesPath: string, callback: InstallCallback): void;\nexport default function installModule(installString: string, nodeModulesPath: string, options: InstallOptions, callback: InstallCallback): void;\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions): Promise<string>;\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions | InstallCallback, callback?: InstallCallback): void | Promise<string> {\n const userOptions = typeof options === 'function' ? {} : options || {};\n const userCallback = typeof options === 'function' ? options : callback;\n const merged = { ...overlay, ...userOptions };\n if (typeof userCallback === 'function') return installModuleCore(installString, nodeModulesPath, merged, userCallback);\n return installModuleCore(installString, nodeModulesPath, merged);\n}\n\nexport function sync(installString: string, nodeModulesPath: string, options?: InstallOptions): string | undefined {\n return syncCore(installString, nodeModulesPath, { ...overlay, ...options });\n}\n\nexport function clear(options?: CleanOptions): void {\n clearCore({ ...overlay, ...options });\n}\n\nexport function install(specifier: string, dest: string, options: InstallOptions, callback: InstallCallback): void;\nexport function install(specifier: string, dest: string, options?: InstallOptions, callback?: InstallCallback): void {\n callback = typeof options === 'function' ? options : (callback as InstallCallback);\n options = typeof options === 'function' ? {} : ((options || {}) as InstallOptions);\n\n installCore(specifier, dest, { ...overlay, ...options }, callback);\n}\n\nexport { parseInstallString };\n"],"names":["clear","installModule","install","parseInstallString","sync","installString","nodeModulesPath","options","callback","userOptions","userCallback","merged","overlay","installModuleCore","syncCore","clearCore","specifier","dest","installCore"],"mappings":";;;;;;;;;;;QAwBgBA;eAAAA;;QAZhB;eAAwBC;;QAiBRC;eAAAA;;QAOPC;eAAAA,uCAAkB;;QAhBXC;eAAAA;;;2EAnBoG;+DAChG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUL,SAASH,cAAcI,aAAqB,EAAEC,eAAuB,EAAEC,OAA0C,EAAEC,QAA0B;IAC1J,IAAMC,cAAc,OAAOF,YAAY,aAAa,CAAC,IAAIA,WAAW,CAAC;IACrE,IAAMG,eAAe,OAAOH,YAAY,aAAaA,UAAUC;IAC/D,IAAMG,SAAS,mBAAKC,iBAAO,EAAKH;IAChC,IAAI,OAAOC,iBAAiB,YAAY,OAAOG,IAAAA,4BAAiB,EAACR,eAAeC,iBAAiBK,QAAQD;IACzG,OAAOG,IAAAA,4BAAiB,EAACR,eAAeC,iBAAiBK;AAC3D;AAEO,SAASP,KAAKC,aAAqB,EAAEC,eAAuB,EAAEC,OAAwB;IAC3F,OAAOO,IAAAA,yBAAQ,EAACT,eAAeC,iBAAiB,mBAAKM,iBAAO,EAAKL;AACnE;AAEO,SAASP,MAAMO,OAAsB;IAC1CQ,IAAAA,0BAAS,EAAC,mBAAKH,iBAAO,EAAKL;AAC7B;AAGO,SAASL,QAAQc,SAAiB,EAAEC,IAAY,EAAEV,OAAwB,EAAEC,QAA0B;IAC3GA,WAAW,OAAOD,YAAY,aAAaA,UAAWC;IACtDD,UAAU,OAAOA,YAAY,aAAa,CAAC,IAAMA,WAAW,CAAC;IAE7DW,IAAAA,4BAAW,EAACF,WAAWC,MAAM,mBAAKL,iBAAO,EAAKL,UAAWC;AAC3D"}
|
package/dist/esm/index.js
CHANGED
|
@@ -23,6 +23,8 @@ export function clear(options) {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
export function install(specifier, dest, options, callback) {
|
|
26
|
+
callback = typeof options === 'function' ? options : callback;
|
|
27
|
+
options = typeof options === 'function' ? {} : options || {};
|
|
26
28
|
installCore(specifier, dest, {
|
|
27
29
|
...overlay,
|
|
28
30
|
...options
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/install-module-linked-compat/src/index.ts"],"sourcesContent":["import type { CleanOptions, InstallCallback, InstallOptions } from 'install-module-linked';\nimport installModuleCore, { clear as clearCore, install as installCore, parseInstallString, sync as syncCore } from 'install-module-linked';\nimport overlay from './compat.ts';\n\nexport type * from 'install-module-linked';\n\n// Identical API to install-module-linked; the overlay supplies the shims the\n// running node lacks (empty on Node >= 18), and user options always win.\n\nexport default function installModule(installString: string, nodeModulesPath: string, callback: InstallCallback): void;\nexport default function installModule(installString: string, nodeModulesPath: string, options: InstallOptions, callback: InstallCallback): void;\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions): Promise<string>;\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions | InstallCallback, callback?: InstallCallback): void | Promise<string> {\n const userOptions = typeof options === 'function' ? {} : options || {};\n const userCallback = typeof options === 'function' ? options : callback;\n const merged = { ...overlay, ...userOptions };\n if (typeof userCallback === 'function') return installModuleCore(installString, nodeModulesPath, merged, userCallback);\n return installModuleCore(installString, nodeModulesPath, merged);\n}\n\nexport function sync(installString: string, nodeModulesPath: string, options?: InstallOptions): string | undefined {\n return syncCore(installString, nodeModulesPath, { ...overlay, ...options });\n}\n\nexport function clear(options?: CleanOptions): void {\n clearCore({ ...overlay, ...options });\n}\n\nexport function install(specifier: string, dest: string, options: InstallOptions, callback: InstallCallback): void {\n installCore(specifier, dest, { ...overlay, ...options }, callback);\n}\n\nexport { parseInstallString };\n"],"names":["installModuleCore","clear","clearCore","install","installCore","parseInstallString","sync","syncCore","overlay","installModule","installString","nodeModulesPath","options","callback","userOptions","userCallback","merged","specifier","dest"],"mappings":"AACA,OAAOA,qBAAqBC,SAASC,SAAS,EAAEC,WAAWC,WAAW,EAAEC,kBAAkB,EAAEC,QAAQC,QAAQ,QAAQ,wBAAwB;AAC5I,OAAOC,aAAa,cAAc;AAUlC,eAAe,SAASC,cAAcC,aAAqB,EAAEC,eAAuB,EAAEC,OAA0C,EAAEC,QAA0B;IAC1J,MAAMC,cAAc,OAAOF,YAAY,aAAa,CAAC,IAAIA,WAAW,CAAC;IACrE,MAAMG,eAAe,OAAOH,YAAY,aAAaA,UAAUC;IAC/D,MAAMG,SAAS;QAAE,GAAGR,OAAO;QAAE,GAAGM,WAAW;IAAC;IAC5C,IAAI,OAAOC,iBAAiB,YAAY,OAAOf,kBAAkBU,eAAeC,iBAAiBK,QAAQD;IACzG,OAAOf,kBAAkBU,eAAeC,iBAAiBK;AAC3D;AAEA,OAAO,SAASV,KAAKI,aAAqB,EAAEC,eAAuB,EAAEC,OAAwB;IAC3F,OAAOL,SAASG,eAAeC,iBAAiB;QAAE,GAAGH,OAAO;QAAE,GAAGI,OAAO;IAAC;AAC3E;AAEA,OAAO,SAASX,MAAMW,OAAsB;IAC1CV,UAAU;QAAE,GAAGM,OAAO;QAAE,GAAGI,OAAO;IAAC;AACrC;
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/install-module-linked-compat/src/index.ts"],"sourcesContent":["import type { CleanOptions, InstallCallback, InstallOptions } from 'install-module-linked';\nimport installModuleCore, { clear as clearCore, install as installCore, parseInstallString, sync as syncCore } from 'install-module-linked';\nimport overlay from './compat.ts';\n\nexport type * from 'install-module-linked';\n\n// Identical API to install-module-linked; the overlay supplies the shims the\n// running node lacks (empty on Node >= 18), and user options always win.\n\nexport default function installModule(installString: string, nodeModulesPath: string, callback: InstallCallback): void;\nexport default function installModule(installString: string, nodeModulesPath: string, options: InstallOptions, callback: InstallCallback): void;\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions): Promise<string>;\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions | InstallCallback, callback?: InstallCallback): void | Promise<string> {\n const userOptions = typeof options === 'function' ? {} : options || {};\n const userCallback = typeof options === 'function' ? options : callback;\n const merged = { ...overlay, ...userOptions };\n if (typeof userCallback === 'function') return installModuleCore(installString, nodeModulesPath, merged, userCallback);\n return installModuleCore(installString, nodeModulesPath, merged);\n}\n\nexport function sync(installString: string, nodeModulesPath: string, options?: InstallOptions): string | undefined {\n return syncCore(installString, nodeModulesPath, { ...overlay, ...options });\n}\n\nexport function clear(options?: CleanOptions): void {\n clearCore({ ...overlay, ...options });\n}\n\nexport function install(specifier: string, dest: string, options: InstallOptions, callback: InstallCallback): void;\nexport function install(specifier: string, dest: string, options?: InstallOptions, callback?: InstallCallback): void {\n callback = typeof options === 'function' ? options : (callback as InstallCallback);\n options = typeof options === 'function' ? {} : ((options || {}) as InstallOptions);\n\n installCore(specifier, dest, { ...overlay, ...options }, callback);\n}\n\nexport { parseInstallString };\n"],"names":["installModuleCore","clear","clearCore","install","installCore","parseInstallString","sync","syncCore","overlay","installModule","installString","nodeModulesPath","options","callback","userOptions","userCallback","merged","specifier","dest"],"mappings":"AACA,OAAOA,qBAAqBC,SAASC,SAAS,EAAEC,WAAWC,WAAW,EAAEC,kBAAkB,EAAEC,QAAQC,QAAQ,QAAQ,wBAAwB;AAC5I,OAAOC,aAAa,cAAc;AAUlC,eAAe,SAASC,cAAcC,aAAqB,EAAEC,eAAuB,EAAEC,OAA0C,EAAEC,QAA0B;IAC1J,MAAMC,cAAc,OAAOF,YAAY,aAAa,CAAC,IAAIA,WAAW,CAAC;IACrE,MAAMG,eAAe,OAAOH,YAAY,aAAaA,UAAUC;IAC/D,MAAMG,SAAS;QAAE,GAAGR,OAAO;QAAE,GAAGM,WAAW;IAAC;IAC5C,IAAI,OAAOC,iBAAiB,YAAY,OAAOf,kBAAkBU,eAAeC,iBAAiBK,QAAQD;IACzG,OAAOf,kBAAkBU,eAAeC,iBAAiBK;AAC3D;AAEA,OAAO,SAASV,KAAKI,aAAqB,EAAEC,eAAuB,EAAEC,OAAwB;IAC3F,OAAOL,SAASG,eAAeC,iBAAiB;QAAE,GAAGH,OAAO;QAAE,GAAGI,OAAO;IAAC;AAC3E;AAEA,OAAO,SAASX,MAAMW,OAAsB;IAC1CV,UAAU;QAAE,GAAGM,OAAO;QAAE,GAAGI,OAAO;IAAC;AACrC;AAGA,OAAO,SAAST,QAAQc,SAAiB,EAAEC,IAAY,EAAEN,OAAwB,EAAEC,QAA0B;IAC3GA,WAAW,OAAOD,YAAY,aAAaA,UAAWC;IACtDD,UAAU,OAAOA,YAAY,aAAa,CAAC,IAAMA,WAAW,CAAC;IAE7DR,YAAYa,WAAWC,MAAM;QAAE,GAAGV,OAAO;QAAE,GAAGI,OAAO;IAAC,GAAGC;AAC3D;AAEA,SAASR,kBAAkB,GAAG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "install-module-linked-compat",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Installs and symlinks a module into node_modules",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"npm",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"get-file-compat": "^2.0.0",
|
|
58
58
|
"getopts-compat": "^2.2.5",
|
|
59
59
|
"homedir-polyfill": "^1.0.3",
|
|
60
|
-
"install-module-linked": "^2.0.
|
|
60
|
+
"install-module-linked": "^2.0.4",
|
|
61
61
|
"mkdirp-classic": "^0.5.2",
|
|
62
62
|
"node-version-call-local": "^1.0.0"
|
|
63
63
|
},
|
|
@@ -72,11 +72,5 @@
|
|
|
72
72
|
},
|
|
73
73
|
"engines": {
|
|
74
74
|
"node": ">=0.8"
|
|
75
|
-
},
|
|
76
|
-
"allowScripts": {
|
|
77
|
-
"node-filename-to-dist-paths": true,
|
|
78
|
-
"node-semvers": true,
|
|
79
|
-
"node-version-use": true,
|
|
80
|
-
"thread-sleep-compat": true
|
|
81
75
|
}
|
|
82
76
|
}
|