node-install-release 1.15.3 → 1.15.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.
@@ -0,0 +1 @@
1
+ export declare function homedir(): string;
@@ -0,0 +1 @@
1
+ export declare function homedir(): string;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Compatibility Layer for Node.js 0.8+
3
+ * Local to this package - contains only needed functions.
4
+ */ "use strict";
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ Object.defineProperty(exports, "homedir", {
9
+ enumerable: true,
10
+ get: function() {
11
+ return homedir;
12
+ }
13
+ });
14
+ var _os = /*#__PURE__*/ _interop_require_default(require("os"));
15
+ function _interop_require_default(obj) {
16
+ return obj && obj.__esModule ? obj : {
17
+ default: obj
18
+ };
19
+ }
20
+ var hasHomedir = typeof _os.default.homedir === 'function';
21
+ function homedir() {
22
+ if (hasHomedir) {
23
+ return _os.default.homedir();
24
+ }
25
+ var home = require('homedir-polyfill');
26
+ return home();
27
+ }
28
+ /* 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; }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/compat.ts"],"sourcesContent":["/**\n * Compatibility Layer for Node.js 0.8+\n * Local to this package - contains only needed functions.\n */\nimport os from 'os';\n\nvar hasHomedir = typeof os.homedir === 'function';\n\nexport function homedir(): string {\n if (hasHomedir) {\n return os.homedir();\n }\n var home = require('homedir-polyfill');\n return home();\n}\n"],"names":["homedir","hasHomedir","os","home","require"],"mappings":"AAAA;;;CAGC;;;;+BAKeA;;;eAAAA;;;yDAJD;;;;;;AAEf,IAAIC,aAAa,OAAOC,WAAE,CAACF,OAAO,KAAK;AAEhC,SAASA;IACd,IAAIC,YAAY;QACd,OAAOC,WAAE,CAACF,OAAO;IACnB;IACA,IAAIG,OAAOC,QAAQ;IACnB,OAAOD;AACT"}
@@ -49,9 +49,9 @@ _export(exports, {
49
49
  return NPM_MIN_VERSION;
50
50
  }
51
51
  });
52
- var _homedirpolyfill = /*#__PURE__*/ _interop_require_default(require("homedir-polyfill"));
53
52
  var _lodashkeys = /*#__PURE__*/ _interop_require_default(require("lodash.keys"));
54
53
  var _path = /*#__PURE__*/ _interop_require_default(require("path"));
54
+ var _compatts = require("./compat.js");
55
55
  var _createStoragePathsts = /*#__PURE__*/ _interop_require_default(require("./createStoragePaths.js"));
56
56
  var _filests = /*#__PURE__*/ _interop_require_default(require("./files.js"));
57
57
  function _interop_require_default(obj) {
@@ -60,7 +60,7 @@ function _interop_require_default(obj) {
60
60
  };
61
61
  }
62
62
  var FILES = _filests.default;
63
- var DEFAULT_STORAGE_PATH = _path.default.join((0, _homedirpolyfill.default)(), '.nir');
63
+ var DEFAULT_STORAGE_PATH = _path.default.join((0, _compatts.homedir)(), '.nir');
64
64
  var DEFAULT_STORAGE_PATHS = (0, _createStoragePathsts.default)(DEFAULT_STORAGE_PATH);
65
65
  var FILE_PLATFORMS = (0, _lodashkeys.default)(FILES).filter(function(file) {
66
66
  return [
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/constants.ts"],"sourcesContent":["import home from 'homedir-polyfill';\nimport keys from 'lodash.keys';\nimport path from 'path';\nimport createStoragePaths from './createStoragePaths.ts';\nimport files from './files.ts';\n\nimport type { FilePath } from './types.ts';\n\nexport const FILES = files;\nexport const DEFAULT_STORAGE_PATH = path.join(home(), '.nir') as string;\nexport const DEFAULT_STORAGE_PATHS = createStoragePaths(DEFAULT_STORAGE_PATH);\n\nexport const FILE_PLATFORMS = keys(FILES).filter((file) => ['src', 'headers'].indexOf(file) < 0) as string[];\n\nexport const FILE_PLATFORM_MAP = {\n win: 'win32',\n win32: 'win',\n osx: 'darwin',\n darwin: 'osx',\n};\n\nexport const EXTENSIONS_COMPRESSED = ['.gz', '.zip', '.xz', '.7z'];\n\nexport const NODE_FILE_PATHS = {\n win32: 'node.exe',\n posix: path.join('bin', 'node') as string,\n};\nexport const NODE_DIST_BASE_URL = 'https://nodejs.org/dist';\nexport const NODE_SCHEDULES_URL = 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json';\n\nexport const NPM_DIST_URL = 'https://registry.npmjs.org/npm';\nexport const NPM_DIST_TAGS_URL = 'https://registry.npmjs.org/-/package/npm/dist-tags';\nexport const NPM_MIN_VERSION = 3;\n\nexport const NPM_FILE_PATHS = {\n win32: [\n { src: path.join('node_modules', 'npm', 'bin', 'npm'), dest: 'npm' },\n { src: path.join('node_modules', 'npm', 'bin', 'npm.cmd'), dest: 'npm.cmd' },\n { src: path.join('node_modules', 'npm', 'bin', 'npx'), dest: 'npx', optional: true },\n { src: path.join('node_modules', 'npm', 'bin', 'npx.cmd'), dest: 'npx.cmd', optional: true },\n ] as FilePath[],\n posix: [\n { src: path.join('lib', 'node_modules', 'npm', 'bin', 'npm-cli.js'), dest: path.join('bin', 'npm') },\n { src: path.join('lib', 'node_modules', 'npm', 'bin', 'npx-cli.js'), dest: path.join('bin', 'npx'), optional: true },\n ] as FilePath[],\n};\n"],"names":["DEFAULT_STORAGE_PATH","DEFAULT_STORAGE_PATHS","EXTENSIONS_COMPRESSED","FILES","FILE_PLATFORMS","FILE_PLATFORM_MAP","NODE_DIST_BASE_URL","NODE_FILE_PATHS","NODE_SCHEDULES_URL","NPM_DIST_TAGS_URL","NPM_DIST_URL","NPM_FILE_PATHS","NPM_MIN_VERSION","files","path","join","home","createStoragePaths","keys","filter","file","indexOf","win","win32","osx","darwin","posix","src","dest","optional"],"mappings":";;;;;;;;;;;QASaA;eAAAA;;QACAC;eAAAA;;QAWAC;eAAAA;;QAbAC;eAAAA;;QAIAC;eAAAA;;QAEAC;eAAAA;;QAaAC;eAAAA;;QAJAC;eAAAA;;QAKAC;eAAAA;;QAGAC;eAAAA;;QADAC;e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AI,CAACC,IAAI,CAAC,OAAO,gBAAgB,OAAO,OAAO;YAAea,MAAMd,aAAI,CAACC,IAAI,CAAC,OAAO;YAAQc,UAAU;QAAK;KACpH;AACH"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/constants.ts"],"sourcesContent":["import keys from 'lodash.keys';\nimport path from 'path';\nimport { homedir } from './compat.ts';\nimport createStoragePaths from './createStoragePaths.ts';\nimport files from './files.ts';\n\nimport type { FilePath } from './types.ts';\n\nexport const FILES = files;\nexport const DEFAULT_STORAGE_PATH = path.join(homedir(), '.nir') as string;\nexport const DEFAULT_STORAGE_PATHS = createStoragePaths(DEFAULT_STORAGE_PATH);\n\nexport const FILE_PLATFORMS = keys(FILES).filter((file) => ['src', 'headers'].indexOf(file) < 0) as string[];\n\nexport const FILE_PLATFORM_MAP = {\n win: 'win32',\n win32: 'win',\n osx: 'darwin',\n darwin: 'osx',\n};\n\nexport const EXTENSIONS_COMPRESSED = ['.gz', '.zip', '.xz', '.7z'];\n\nexport const NODE_FILE_PATHS = {\n win32: 'node.exe',\n posix: path.join('bin', 'node') as string,\n};\nexport const NODE_DIST_BASE_URL = 'https://nodejs.org/dist';\nexport const NODE_SCHEDULES_URL = 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json';\n\nexport const NPM_DIST_URL = 'https://registry.npmjs.org/npm';\nexport const NPM_DIST_TAGS_URL = 'https://registry.npmjs.org/-/package/npm/dist-tags';\nexport const NPM_MIN_VERSION = 3;\n\nexport const NPM_FILE_PATHS = {\n win32: [\n { src: path.join('node_modules', 'npm', 'bin', 'npm'), dest: 'npm' },\n { src: path.join('node_modules', 'npm', 'bin', 'npm.cmd'), dest: 'npm.cmd' },\n { src: path.join('node_modules', 'npm', 'bin', 'npx'), dest: 'npx', optional: true },\n { src: path.join('node_modules', 'npm', 'bin', 'npx.cmd'), dest: 'npx.cmd', optional: true },\n ] as FilePath[],\n posix: [\n { src: path.join('lib', 'node_modules', 'npm', 'bin', 'npm-cli.js'), dest: path.join('bin', 'npm') },\n { src: path.join('lib', 'node_modules', 'npm', 'bin', 'npx-cli.js'), dest: path.join('bin', 'npx'), optional: true },\n ] as FilePath[],\n};\n"],"names":["DEFAULT_STORAGE_PATH","DEFAULT_STORAGE_PATHS","EXTENSIONS_COMPRESSED","FILES","FILE_PLATFORMS","FILE_PLATFORM_MAP","NODE_DIST_BASE_URL","NODE_FILE_PATHS","NODE_SCHEDULES_URL","NPM_DIST_TAGS_URL","NPM_DIST_URL","NPM_FILE_PATHS","NPM_MIN_VERSION","files","path","join","homedir","createStoragePaths","keys","filter","file","indexOf","win","win32","osx","darwin","posix","src","dest","optional"],"mappings":";;;;;;;;;;;QASaA;eAAAA;;QACAC;eAAAA;;QAWAC;eAAAA;;QAbAC;eAAAA;;QAIAC;eAAAA;;QAEAC;eAAAA;;QAaAC;eAAAA;;QAJAC;eAAAA;;QAKAC;eAAAA;;QAGAC;eAAAA;;QADAC;eAAAA;;QAIAC;eAAAA;;QAFAC;eAAAA;;;iEAhCI;2DACA;wBACO;2EACO;8DACb;;;;;;AAIX,IAAMT,QAAQU,gBAAK;AACnB,IAAMb,uBAAuBc,aAAI,CAACC,IAAI,CAACC,IAAAA,iBAAO,KAAI;AAClD,IAAMf,wBAAwBgB,IAAAA,6BAAkB,EAACjB;AAEjD,IAAMI,iBAAiBc,IAAAA,mBAAI,EAACf,OAAOgB,MAAM,CAAC,SAACC;WAAS;QAAC;QAAO;KAAU,CAACC,OAAO,CAACD,QAAQ;;AAEvF,IAAMf,oBAAoB;IAC/BiB,KAAK;IACLC,OAAO;IACPC,KAAK;IACLC,QAAQ;AACV;AAEO,IAAMvB,wBAAwB;IAAC;IAAO;IAAQ;IAAO;CAAM;AAE3D,IAAMK,kBAAkB;IAC7BgB,OAAO;IACPG,OAAOZ,aAAI,CAACC,IAAI,CAAC,OAAO;AAC1B;AACO,IAAMT,qBAAqB;AAC3B,IAAME,qBAAqB;AAE3B,IAAME,eAAe;AACrB,IAAMD,oBAAoB;AAC1B,IAAMG,kBAAkB;AAExB,IAAMD,iBAAiB;IAC5BY,OAAO;QACL;YAAEI,KAAKb,aAAI,CAACC,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAQa,MAAM;QAAM;QACnE;YAAED,KAAKb,aAAI,CAACC,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAYa,MAAM;QAAU;QAC3E;YAAED,KAAKb,aAAI,CAACC,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAQa,MAAM;YAAOC,UAAU;QAAK;QACnF;YAAEF,KAAKb,aAAI,CAACC,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAYa,MAAM;YAAWC,UAAU;QAAK;KAC5F;IACDH,OAAO;QACL;YAAEC,KAAKb,aAAI,CAACC,IAAI,CAAC,OAAO,gBAAgB,OAAO,OAAO;YAAea,MAAMd,aAAI,CAACC,IAAI,CAAC,OAAO;QAAO;QACnG;YAAEY,KAAKb,aAAI,CAACC,IAAI,CAAC,OAAO,gBAAgB,OAAO,OAAO;YAAea,MAAMd,aAAI,CAACC,IAAI,CAAC,OAAO;YAAQc,UAAU;QAAK;KACpH;AACH"}
@@ -1,2 +1,2 @@
1
- import { type NoParamCallback } from 'fs';
1
+ import type { NoParamCallback } from 'fs';
2
2
  export default function safeCopyFile(src: string, dest: string, callback: NoParamCallback): void;
@@ -1,2 +1,2 @@
1
- import { type NoParamCallback } from 'fs';
1
+ import type { NoParamCallback } from 'fs';
2
2
  export default function safeCopyFile(src: string, dest: string, callback: NoParamCallback): void;
@@ -8,8 +8,7 @@ Object.defineProperty(exports, "default", {
8
8
  return safeCopyFile;
9
9
  }
10
10
  });
11
- var _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
12
- var _pump = /*#__PURE__*/ _interop_require_default(require("pump"));
11
+ var _fscopycompat = require("fs-copy-compat");
13
12
  var _queuecb = /*#__PURE__*/ _interop_require_default(require("queue-cb"));
14
13
  var _rimraf2 = /*#__PURE__*/ _interop_require_default(require("rimraf2"));
15
14
  var _ensureDestinationParentts = /*#__PURE__*/ _interop_require_default(require("./ensureDestinationParent.js"));
@@ -18,13 +17,6 @@ function _interop_require_default(obj) {
18
17
  default: obj
19
18
  };
20
19
  }
21
- function streamCopyFile(src, dest, callback) {
22
- _fs.default.stat(src, function(err) {
23
- if (err) return callback(err);
24
- (0, _pump.default)(_fs.default.createReadStream(src), _fs.default.createWriteStream(dest), callback);
25
- });
26
- }
27
- var copyFile = _fs.default.copyFile || streamCopyFile;
28
20
  function safeCopyFile(src, dest, callback) {
29
21
  var queue = new _queuecb.default(1);
30
22
  queue.defer(_ensureDestinationParentts.default.bind(null, dest));
@@ -35,7 +27,7 @@ function safeCopyFile(src, dest, callback) {
35
27
  err && err.code !== 'EEXIST' ? callback(err) : callback();
36
28
  });
37
29
  });
38
- queue.defer(copyFile.bind(null, src, dest));
30
+ queue.defer(_fscopycompat.copyFile.bind(null, src, dest));
39
31
  queue.await(callback);
40
32
  }
41
33
  /* 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; }
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/copyFile.ts"],"sourcesContent":["import fs, { type NoParamCallback } from 'fs';\nimport pump from 'pump';\nimport Queue from 'queue-cb';\nimport rimraf2 from 'rimraf2';\n\nimport ensureDestinationParent from './ensureDestinationParent.ts';\n\nfunction streamCopyFile(src: string, dest: string, callback: NoParamCallback): undefined {\n fs.stat(src, (err) => {\n if (err) return callback(err);\n pump(fs.createReadStream(src), fs.createWriteStream(dest), callback);\n });\n}\n\nconst copyFile = fs.copyFile || streamCopyFile;\n\nexport default function safeCopyFile(src: string, dest: string, callback: NoParamCallback) {\n const queue = new Queue(1);\n\n queue.defer(ensureDestinationParent.bind(null, dest));\n queue.defer((callback) => {\n rimraf2(dest, { disableGlob: true }, (err) => {\n err && err.code !== 'EEXIST' ? callback(err) : callback();\n });\n });\n queue.defer(copyFile.bind(null, src, dest));\n queue.await(callback);\n}\n"],"names":["safeCopyFile","streamCopyFile","src","dest","callback","fs","stat","err","pump","createReadStream","createWriteStream","copyFile","queue","Queue","defer","ensureDestinationParent","bind","rimraf2","disableGlob","code","await"],"mappings":";;;;+BAgBA;;;eAAwBA;;;yDAhBiB;2DACxB;8DACC;8DACE;gFAEgB;;;;;;AAEpC,SAASC,eAAeC,GAAW,EAAEC,IAAY,EAAEC,QAAyB;IAC1EC,WAAE,CAACC,IAAI,CAACJ,KAAK,SAACK;QACZ,IAAIA,KAAK,OAAOH,SAASG;QACzBC,IAAAA,aAAI,EAACH,WAAE,CAACI,gBAAgB,CAACP,MAAMG,WAAE,CAACK,iBAAiB,CAACP,OAAOC;IAC7D;AACF;AAEA,IAAMO,WAAWN,WAAE,CAACM,QAAQ,IAAIV;AAEjB,SAASD,aAAaE,GAAW,EAAEC,IAAY,EAAEC,QAAyB;IACvF,IAAMQ,QAAQ,IAAIC,gBAAK,CAAC;IAExBD,MAAME,KAAK,CAACC,kCAAuB,CAACC,IAAI,CAAC,MAAMb;IAC/CS,MAAME,KAAK,CAAC,SAACV;QACXa,IAAAA,gBAAO,EAACd,MAAM;YAAEe,aAAa;QAAK,GAAG,SAACX;YACpCA,OAAOA,IAAIY,IAAI,KAAK,WAAWf,SAASG,OAAOH;QACjD;IACF;IACAQ,MAAME,KAAK,CAACH,SAASK,IAAI,CAAC,MAAMd,KAAKC;IACrCS,MAAMQ,KAAK,CAAChB;AACd"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/copyFile.ts"],"sourcesContent":["import type { NoParamCallback } from 'fs';\nimport { copyFile } from 'fs-copy-compat';\nimport Queue from 'queue-cb';\nimport rimraf2 from 'rimraf2';\n\nimport ensureDestinationParent from './ensureDestinationParent.ts';\n\nexport default function safeCopyFile(src: string, dest: string, callback: NoParamCallback) {\n const queue = new Queue(1);\n\n queue.defer(ensureDestinationParent.bind(null, dest));\n queue.defer((callback) => {\n rimraf2(dest, { disableGlob: true }, (err) => {\n err && err.code !== 'EEXIST' ? callback(err) : callback();\n });\n });\n queue.defer(copyFile.bind(null, src, dest));\n queue.await(callback);\n}\n"],"names":["safeCopyFile","src","dest","callback","queue","Queue","defer","ensureDestinationParent","bind","rimraf2","disableGlob","err","code","copyFile","await"],"mappings":";;;;+BAOA;;;eAAwBA;;;4BANC;8DACP;8DACE;gFAEgB;;;;;;AAErB,SAASA,aAAaC,GAAW,EAAEC,IAAY,EAAEC,QAAyB;IACvF,IAAMC,QAAQ,IAAIC,gBAAK,CAAC;IAExBD,MAAME,KAAK,CAACC,kCAAuB,CAACC,IAAI,CAAC,MAAMN;IAC/CE,MAAME,KAAK,CAAC,SAACH;QACXM,IAAAA,gBAAO,EAACP,MAAM;YAAEQ,aAAa;QAAK,GAAG,SAACC;YACpCA,OAAOA,IAAIC,IAAI,KAAK,WAAWT,SAASQ,OAAOR;QACjD;IACF;IACAC,MAAME,KAAK,CAACO,sBAAQ,CAACL,IAAI,CAAC,MAAMP,KAAKC;IACrCE,MAAMU,KAAK,CAACX;AACd"}
@@ -0,0 +1 @@
1
+ export declare function homedir(): string;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Compatibility Layer for Node.js 0.8+
3
+ * Local to this package - contains only needed functions.
4
+ */ import os from 'os';
5
+ var hasHomedir = typeof os.homedir === 'function';
6
+ export function homedir() {
7
+ if (hasHomedir) {
8
+ return os.homedir();
9
+ }
10
+ var home = require('homedir-polyfill');
11
+ return home();
12
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/compat.ts"],"sourcesContent":["/**\n * Compatibility Layer for Node.js 0.8+\n * Local to this package - contains only needed functions.\n */\nimport os from 'os';\n\nvar hasHomedir = typeof os.homedir === 'function';\n\nexport function homedir(): string {\n if (hasHomedir) {\n return os.homedir();\n }\n var home = require('homedir-polyfill');\n return home();\n}\n"],"names":["os","hasHomedir","homedir","home","require"],"mappings":"AAAA;;;CAGC,GACD,OAAOA,QAAQ,KAAK;AAEpB,IAAIC,aAAa,OAAOD,GAAGE,OAAO,KAAK;AAEvC,OAAO,SAASA;IACd,IAAID,YAAY;QACd,OAAOD,GAAGE,OAAO;IACnB;IACA,IAAIC,OAAOC,QAAQ;IACnB,OAAOD;AACT"}
@@ -1,10 +1,10 @@
1
- import home from 'homedir-polyfill';
2
1
  import keys from 'lodash.keys';
3
2
  import path from 'path';
3
+ import { homedir } from './compat.js';
4
4
  import createStoragePaths from './createStoragePaths.js';
5
5
  import files from './files.js';
6
6
  export const FILES = files;
7
- export const DEFAULT_STORAGE_PATH = path.join(home(), '.nir');
7
+ export const DEFAULT_STORAGE_PATH = path.join(homedir(), '.nir');
8
8
  export const DEFAULT_STORAGE_PATHS = createStoragePaths(DEFAULT_STORAGE_PATH);
9
9
  export const FILE_PLATFORMS = keys(FILES).filter((file)=>[
10
10
  'src',
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/constants.ts"],"sourcesContent":["import home from 'homedir-polyfill';\nimport keys from 'lodash.keys';\nimport path from 'path';\nimport createStoragePaths from './createStoragePaths.ts';\nimport files from './files.ts';\n\nimport type { FilePath } from './types.ts';\n\nexport const FILES = files;\nexport const DEFAULT_STORAGE_PATH = path.join(home(), '.nir') as string;\nexport const DEFAULT_STORAGE_PATHS = createStoragePaths(DEFAULT_STORAGE_PATH);\n\nexport const FILE_PLATFORMS = keys(FILES).filter((file) => ['src', 'headers'].indexOf(file) < 0) as string[];\n\nexport const FILE_PLATFORM_MAP = {\n win: 'win32',\n win32: 'win',\n osx: 'darwin',\n darwin: 'osx',\n};\n\nexport const EXTENSIONS_COMPRESSED = ['.gz', '.zip', '.xz', '.7z'];\n\nexport const NODE_FILE_PATHS = {\n win32: 'node.exe',\n posix: path.join('bin', 'node') as string,\n};\nexport const NODE_DIST_BASE_URL = 'https://nodejs.org/dist';\nexport const NODE_SCHEDULES_URL = 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json';\n\nexport const NPM_DIST_URL = 'https://registry.npmjs.org/npm';\nexport const NPM_DIST_TAGS_URL = 'https://registry.npmjs.org/-/package/npm/dist-tags';\nexport const NPM_MIN_VERSION = 3;\n\nexport const NPM_FILE_PATHS = {\n win32: [\n { src: path.join('node_modules', 'npm', 'bin', 'npm'), dest: 'npm' },\n { src: path.join('node_modules', 'npm', 'bin', 'npm.cmd'), dest: 'npm.cmd' },\n { src: path.join('node_modules', 'npm', 'bin', 'npx'), dest: 'npx', optional: true },\n { src: path.join('node_modules', 'npm', 'bin', 'npx.cmd'), dest: 'npx.cmd', optional: true },\n ] as FilePath[],\n posix: [\n { src: path.join('lib', 'node_modules', 'npm', 'bin', 'npm-cli.js'), dest: path.join('bin', 'npm') },\n { src: path.join('lib', 'node_modules', 'npm', 'bin', 'npx-cli.js'), dest: path.join('bin', 'npx'), optional: true },\n ] as FilePath[],\n};\n"],"names":["home","keys","path","createStoragePaths","files","FILES","DEFAULT_STORAGE_PATH","join","DEFAULT_STORAGE_PATHS","FILE_PLATFORMS","filter","file","indexOf","FILE_PLATFORM_MAP","win","win32","osx","darwin","EXTENSIONS_COMPRESSED","NODE_FILE_PATHS","posix","NODE_DIST_BASE_URL","NODE_SCHEDULES_URL","NPM_DIST_URL","NPM_DIST_TAGS_URL","NPM_MIN_VERSION","NPM_FILE_PATHS","src","dest","optional"],"mappings":"AAAA,OAAOA,UAAU,mBAAmB;AACpC,OAAOC,UAAU,cAAc;AAC/B,OAAOC,UAAU,OAAO;AACxB,OAAOC,wBAAwB,0BAA0B;AACzD,OAAOC,WAAW,aAAa;AAI/B,OAAO,MAAMC,QAAQD,MAAM;AAC3B,OAAO,MAAME,uBAAuBJ,KAAKK,IAAI,CAACP,QAAQ,QAAkB;AACxE,OAAO,MAAMQ,wBAAwBL,mBAAmBG,sBAAsB;AAE9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3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/constants.ts"],"sourcesContent":["import keys from 'lodash.keys';\nimport path from 'path';\nimport { homedir } from './compat.ts';\nimport createStoragePaths from './createStoragePaths.ts';\nimport files from './files.ts';\n\nimport type { FilePath } from './types.ts';\n\nexport const FILES = files;\nexport const DEFAULT_STORAGE_PATH = path.join(homedir(), '.nir') as string;\nexport const DEFAULT_STORAGE_PATHS = createStoragePaths(DEFAULT_STORAGE_PATH);\n\nexport const FILE_PLATFORMS = keys(FILES).filter((file) => ['src', 'headers'].indexOf(file) < 0) as string[];\n\nexport const FILE_PLATFORM_MAP = {\n win: 'win32',\n win32: 'win',\n osx: 'darwin',\n darwin: 'osx',\n};\n\nexport const EXTENSIONS_COMPRESSED = ['.gz', '.zip', '.xz', '.7z'];\n\nexport const NODE_FILE_PATHS = {\n win32: 'node.exe',\n posix: path.join('bin', 'node') as string,\n};\nexport const NODE_DIST_BASE_URL = 'https://nodejs.org/dist';\nexport const NODE_SCHEDULES_URL = 'https://raw.githubusercontent.com/nodejs/Release/master/schedule.json';\n\nexport const NPM_DIST_URL = 'https://registry.npmjs.org/npm';\nexport const NPM_DIST_TAGS_URL = 'https://registry.npmjs.org/-/package/npm/dist-tags';\nexport const NPM_MIN_VERSION = 3;\n\nexport const NPM_FILE_PATHS = {\n win32: [\n { src: path.join('node_modules', 'npm', 'bin', 'npm'), dest: 'npm' },\n { src: path.join('node_modules', 'npm', 'bin', 'npm.cmd'), dest: 'npm.cmd' },\n { src: path.join('node_modules', 'npm', 'bin', 'npx'), dest: 'npx', optional: true },\n { src: path.join('node_modules', 'npm', 'bin', 'npx.cmd'), dest: 'npx.cmd', optional: true },\n ] as FilePath[],\n posix: [\n { src: path.join('lib', 'node_modules', 'npm', 'bin', 'npm-cli.js'), dest: path.join('bin', 'npm') },\n { src: path.join('lib', 'node_modules', 'npm', 'bin', 'npx-cli.js'), dest: path.join('bin', 'npx'), optional: true },\n ] as FilePath[],\n};\n"],"names":["keys","path","homedir","createStoragePaths","files","FILES","DEFAULT_STORAGE_PATH","join","DEFAULT_STORAGE_PATHS","FILE_PLATFORMS","filter","file","indexOf","FILE_PLATFORM_MAP","win","win32","osx","darwin","EXTENSIONS_COMPRESSED","NODE_FILE_PATHS","posix","NODE_DIST_BASE_URL","NODE_SCHEDULES_URL","NPM_DIST_URL","NPM_DIST_TAGS_URL","NPM_MIN_VERSION","NPM_FILE_PATHS","src","dest","optional"],"mappings":"AAAA,OAAOA,UAAU,cAAc;AAC/B,OAAOC,UAAU,OAAO;AACxB,SAASC,OAAO,QAAQ,cAAc;AACtC,OAAOC,wBAAwB,0BAA0B;AACzD,OAAOC,WAAW,aAAa;AAI/B,OAAO,MAAMC,QAAQD,MAAM;AAC3B,OAAO,MAAME,uBAAuBL,KAAKM,IAAI,CAACL,WAAW,QAAkB;AAC3E,OAAO,MAAMM,wBAAwBL,mBAAmBG,sBAAsB;AAE9E,OAAO,MAAMG,iBAAiBT,KAAKK,OAAOK,MAAM,CAAC,CAACC,OAAS;QAAC;QAAO;KAAU,CAACC,OAAO,CAACD,QAAQ,GAAe;AAE7G,OAAO,MAAME,oBAAoB;IAC/BC,KAAK;IACLC,OAAO;IACPC,KAAK;IACLC,QAAQ;AACV,EAAE;AAEF,OAAO,MAAMC,wBAAwB;IAAC;IAAO;IAAQ;IAAO;CAAM,CAAC;AAEnE,OAAO,MAAMC,kBAAkB;IAC7BJ,OAAO;IACPK,OAAOnB,KAAKM,IAAI,CAAC,OAAO;AAC1B,EAAE;AACF,OAAO,MAAMc,qBAAqB,0BAA0B;AAC5D,OAAO,MAAMC,qBAAqB,wEAAwE;AAE1G,OAAO,MAAMC,eAAe,iCAAiC;AAC7D,OAAO,MAAMC,oBAAoB,qDAAqD;AACtF,OAAO,MAAMC,kBAAkB,EAAE;AAEjC,OAAO,MAAMC,iBAAiB;IAC5BX,OAAO;QACL;YAAEY,KAAK1B,KAAKM,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAQqB,MAAM;QAAM;QACnE;YAAED,KAAK1B,KAAKM,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAYqB,MAAM;QAAU;QAC3E;YAAED,KAAK1B,KAAKM,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAQqB,MAAM;YAAOC,UAAU;QAAK;QACnF;YAAEF,KAAK1B,KAAKM,IAAI,CAAC,gBAAgB,OAAO,OAAO;YAAYqB,MAAM;YAAWC,UAAU;QAAK;KAC5F;IACDT,OAAO;QACL;YAAEO,KAAK1B,KAAKM,IAAI,CAAC,OAAO,gBAAgB,OAAO,OAAO;YAAeqB,MAAM3B,KAAKM,IAAI,CAAC,OAAO;QAAO;QACnG;YAAEoB,KAAK1B,KAAKM,IAAI,CAAC,OAAO,gBAAgB,OAAO,OAAO;YAAeqB,MAAM3B,KAAKM,IAAI,CAAC,OAAO;YAAQsB,UAAU;QAAK;KACpH;AACH,EAAE"}
@@ -1,2 +1,2 @@
1
- import { type NoParamCallback } from 'fs';
1
+ import type { NoParamCallback } from 'fs';
2
2
  export default function safeCopyFile(src: string, dest: string, callback: NoParamCallback): void;
@@ -1,15 +1,7 @@
1
- import fs from 'fs';
2
- import pump from 'pump';
1
+ import { copyFile } from 'fs-copy-compat';
3
2
  import Queue from 'queue-cb';
4
3
  import rimraf2 from 'rimraf2';
5
4
  import ensureDestinationParent from './ensureDestinationParent.js';
6
- function streamCopyFile(src, dest, callback) {
7
- fs.stat(src, (err)=>{
8
- if (err) return callback(err);
9
- pump(fs.createReadStream(src), fs.createWriteStream(dest), callback);
10
- });
11
- }
12
- const copyFile = fs.copyFile || streamCopyFile;
13
5
  export default function safeCopyFile(src, dest, callback) {
14
6
  const queue = new Queue(1);
15
7
  queue.defer(ensureDestinationParent.bind(null, dest));
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/copyFile.ts"],"sourcesContent":["import fs, { type NoParamCallback } from 'fs';\nimport pump from 'pump';\nimport Queue from 'queue-cb';\nimport rimraf2 from 'rimraf2';\n\nimport ensureDestinationParent from './ensureDestinationParent.ts';\n\nfunction streamCopyFile(src: string, dest: string, callback: NoParamCallback): undefined {\n fs.stat(src, (err) => {\n if (err) return callback(err);\n pump(fs.createReadStream(src), fs.createWriteStream(dest), callback);\n });\n}\n\nconst copyFile = fs.copyFile || streamCopyFile;\n\nexport default function safeCopyFile(src: string, dest: string, callback: NoParamCallback) {\n const queue = new Queue(1);\n\n queue.defer(ensureDestinationParent.bind(null, dest));\n queue.defer((callback) => {\n rimraf2(dest, { disableGlob: true }, (err) => {\n err && err.code !== 'EEXIST' ? callback(err) : callback();\n });\n });\n queue.defer(copyFile.bind(null, src, dest));\n queue.await(callback);\n}\n"],"names":["fs","pump","Queue","rimraf2","ensureDestinationParent","streamCopyFile","src","dest","callback","stat","err","createReadStream","createWriteStream","copyFile","safeCopyFile","queue","defer","bind","disableGlob","code","await"],"mappings":"AAAA,OAAOA,QAAkC,KAAK;AAC9C,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAC7B,OAAOC,aAAa,UAAU;AAE9B,OAAOC,6BAA6B,+BAA+B;AAEnE,SAASC,eAAeC,GAAW,EAAEC,IAAY,EAAEC,QAAyB;IAC1ER,GAAGS,IAAI,CAACH,KAAK,CAACI;QACZ,IAAIA,KAAK,OAAOF,SAASE;QACzBT,KAAKD,GAAGW,gBAAgB,CAACL,MAAMN,GAAGY,iBAAiB,CAACL,OAAOC;IAC7D;AACF;AAEA,MAAMK,WAAWb,GAAGa,QAAQ,IAAIR;AAEhC,eAAe,SAASS,aAAaR,GAAW,EAAEC,IAAY,EAAEC,QAAyB;IACvF,MAAMO,QAAQ,IAAIb,MAAM;IAExBa,MAAMC,KAAK,CAACZ,wBAAwBa,IAAI,CAAC,MAAMV;IAC/CQ,MAAMC,KAAK,CAAC,CAACR;QACXL,QAAQI,MAAM;YAAEW,aAAa;QAAK,GAAG,CAACR;YACpCA,OAAOA,IAAIS,IAAI,KAAK,WAAWX,SAASE,OAAOF;QACjD;IACF;IACAO,MAAMC,KAAK,CAACH,SAASI,IAAI,CAAC,MAAMX,KAAKC;IACrCQ,MAAMK,KAAK,CAACZ;AACd"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/lib/copyFile.ts"],"sourcesContent":["import type { NoParamCallback } from 'fs';\nimport { copyFile } from 'fs-copy-compat';\nimport Queue from 'queue-cb';\nimport rimraf2 from 'rimraf2';\n\nimport ensureDestinationParent from './ensureDestinationParent.ts';\n\nexport default function safeCopyFile(src: string, dest: string, callback: NoParamCallback) {\n const queue = new Queue(1);\n\n queue.defer(ensureDestinationParent.bind(null, dest));\n queue.defer((callback) => {\n rimraf2(dest, { disableGlob: true }, (err) => {\n err && err.code !== 'EEXIST' ? callback(err) : callback();\n });\n });\n queue.defer(copyFile.bind(null, src, dest));\n queue.await(callback);\n}\n"],"names":["copyFile","Queue","rimraf2","ensureDestinationParent","safeCopyFile","src","dest","callback","queue","defer","bind","disableGlob","err","code","await"],"mappings":"AACA,SAASA,QAAQ,QAAQ,iBAAiB;AAC1C,OAAOC,WAAW,WAAW;AAC7B,OAAOC,aAAa,UAAU;AAE9B,OAAOC,6BAA6B,+BAA+B;AAEnE,eAAe,SAASC,aAAaC,GAAW,EAAEC,IAAY,EAAEC,QAAyB;IACvF,MAAMC,QAAQ,IAAIP,MAAM;IAExBO,MAAMC,KAAK,CAACN,wBAAwBO,IAAI,CAAC,MAAMJ;IAC/CE,MAAMC,KAAK,CAAC,CAACF;QACXL,QAAQI,MAAM;YAAEK,aAAa;QAAK,GAAG,CAACC;YACpCA,OAAOA,IAAIC,IAAI,KAAK,WAAWN,SAASK,OAAOL;QACjD;IACF;IACAC,MAAMC,KAAK,CAACT,SAASU,IAAI,CAAC,MAAML,KAAKC;IACrCE,MAAMM,KAAK,CAACP;AACd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-install-release",
3
- "version": "1.15.3",
3
+ "version": "1.15.4",
4
4
  "description": "Cross-platform solution for installing releases of Node.js",
5
5
  "keywords": [
6
6
  "node",
@@ -46,6 +46,7 @@
46
46
  "cross-spawn-cb": "*",
47
47
  "exit": "*",
48
48
  "fast-extract": "*",
49
+ "fs-copy-compat": "*",
49
50
  "get-remote": "*",
50
51
  "getopts-compat": "*",
51
52
  "homedir-polyfill": "*",
@@ -55,7 +56,6 @@
55
56
  "node-filename-to-dist-paths": "*",
56
57
  "node-resolve-versions": "*",
57
58
  "on-one": "*",
58
- "pump": "*",
59
59
  "queue-cb": "*",
60
60
  "rimraf2": "*"
61
61
  },