install-module-linked
Advanced tools
| #!/usr/bin/env node | ||
| declare const _default: (argv: string[], name?: string) => undefined; | ||
| declare const _default: (argv: string[], name?: string) => void; | ||
| export default _default; |
| #!/usr/bin/env node | ||
| declare const _default: (argv: string[], name?: string) => undefined; | ||
| declare const _default: (argv: string[], name?: string) => void; | ||
| export default _default; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/install-module-linked/src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport exit from 'exit-compat';\nimport fs from 'fs';\nimport getopts from 'getopts-compat';\nimport path from 'path';\nimport url from 'url';\nimport clear from './lib/clear.ts';\n\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\n\nconst ERROR_CODE = 7;\n\nfunction getVersion(): string {\n const packageJsonPath = path.join(__dirname, '..', '..', 'package.json');\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));\n return packageJson.version;\n}\n\nfunction printHelp(name: string): void {\n const version = getVersion();\n console.log(`${name} v${version}`);\n console.log('');\n console.log(`Usage: ${name} [options] [command]`);\n console.log('');\n console.log('Commands:');\n console.log(' clear Clear the module cache');\n console.log('');\n console.log('Options:');\n console.log(' -v, --version Print version number');\n console.log(' -h, --help Print this help message');\n}\n\nexport default (argv: string[], name?: string): undefined => {\n name = name || 'iml';\n const options = getopts(argv, {\n alias: { version: 'v', help: 'h' },\n boolean: ['version', 'help'],\n stopEarly: true,\n });\n\n if (options.version) {\n console.log(getVersion());\n exit(0);\n return;\n }\n\n if (options.help) {\n printHelp(name);\n exit(0);\n return;\n }\n\n const args = options._;\n if (!args.length) {\n console.log(`Missing command. Example usage: ${name} [command]`);\n console.log(`Run \"${name} --help\" for more information.`);\n exit(ERROR_CODE);\n return;\n }\n\n if (args[0] === 'clear') {\n clear();\n exit(0);\n return;\n }\n\n console.log(`Unrecognized command: ${args[0]}. Example usage: ${name} [command]`);\n console.log(`Run \"${name} --help\" for more information.`);\n exit(ERROR_CODE);\n};\n"],"names":["__dirname","path","dirname","__filename","url","fileURLToPath","ERROR_CODE","getVersion","packageJsonPath","join","packageJson","JSON","parse","fs","readFileSync","version","printHelp","name","console","log","argv","options","getopts","alias","help","boolean","stopEarly","exit","args","_","length","clear"],"mappings":";;;;;+BAiCA;;;eAAA;;;iEA/BiB;yDACF;oEACK;2DACH;0DACD;8DACE;;;;;;AAElB,IAAMA,YAAYC,aAAI,CAACC,OAAO,CAAC,OAAOC,eAAe,cAAcA,aAAaC,YAAG,CAACC,aAAa,CAAC;AAElG,IAAMC,aAAa;AAEnB,SAASC;IACP,IAAMC,kBAAkBP,aAAI,CAACQ,IAAI,CAACT,WAAW,MAAM,MAAM;IACzD,IAAMU,cAAcC,KAAKC,KAAK,CAACC,WAAE,CAACC,YAAY,CAACN,iBAAiB;IAChE,OAAOE,YAAYK,OAAO;AAC5B;AAEA,SAASC,UAAUC,IAAY;IAC7B,IAAMF,UAAUR;IAChBW,QAAQC,GAAG,CAAC,AAAC,GAAWJ,OAATE,MAAK,MAAY,OAARF;IACxBG,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC,AAAC,UAAc,OAALF,MAAK;IAC3BC,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;AACd;IAEA,WAAe,SAACC,MAAgBH;IAC9BA,OAAOA,QAAQ;IACf,IAAMI,UAAUC,IAAAA,sBAAO,EAACF,MAAM;QAC5BG,OAAO;YAAER,SAAS;YAAKS,MAAM;QAAI;QACjCC,SAAS;YAAC;YAAW;SAAO;QAC5BC,WAAW;IACb;IAEA,IAAIL,QAAQN,OAAO,EAAE;QACnBG,QAAQC,GAAG,CAACZ;QACZoB,IAAAA,mBAAI,EAAC;QACL;IACF;IAEA,IAAIN,QAAQG,IAAI,EAAE;QAChBR,UAAUC;QACVU,IAAAA,mBAAI,EAAC;QACL;IACF;IAEA,IAAMC,OAAOP,QAAQQ,CAAC;IACtB,IAAI,CAACD,KAAKE,MAAM,EAAE;QAChBZ,QAAQC,GAAG,CAAC,AAAC,mCAAuC,OAALF,MAAK;QACpDC,QAAQC,GAAG,CAAC,AAAC,QAAY,OAALF,MAAK;QACzBU,IAAAA,mBAAI,EAACrB;QACL;IACF;IAEA,IAAIsB,IAAI,CAAC,EAAE,KAAK,SAAS;QACvBG,IAAAA,gBAAK;QACLJ,IAAAA,mBAAI,EAAC;QACL;IACF;IAEAT,QAAQC,GAAG,CAAC,AAAC,yBAAmDF,OAA3BW,IAAI,CAAC,EAAE,EAAC,qBAAwB,OAALX,MAAK;IACrEC,QAAQC,GAAG,CAAC,AAAC,QAAY,OAALF,MAAK;IACzBU,IAAAA,mBAAI,EAACrB;AACP"} | ||
| {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/install-module-linked/src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport exit from 'exit-compat';\nimport fs from 'fs';\nimport getopts from 'getopts-compat';\nimport path from 'path';\nimport url from 'url';\nimport clear from './lib/clear.ts';\n\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\n\nconst ERROR_CODE = 7;\n\nfunction getVersion(): string {\n const packageJsonPath = path.join(__dirname, '..', '..', 'package.json');\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));\n return packageJson.version;\n}\n\nfunction printHelp(name: string): void {\n const version = getVersion();\n console.log(`${name} v${version}`);\n console.log('');\n console.log(`Usage: ${name} [options] [command]`);\n console.log('');\n console.log('Commands:');\n console.log(' clear Clear the module cache');\n console.log('');\n console.log('Options:');\n console.log(' -v, --version Print version number');\n console.log(' -h, --help Print this help message');\n}\n\nexport default (argv: string[], name?: string): void => {\n name = name || 'iml';\n const options = getopts(argv, {\n alias: { version: 'v', help: 'h' },\n boolean: ['version', 'help'],\n stopEarly: true,\n });\n\n if (options.version) {\n console.log(getVersion());\n exit(0);\n return;\n }\n\n if (options.help) {\n printHelp(name);\n exit(0);\n return;\n }\n\n const args = options._;\n if (!args.length) {\n console.log(`Missing command. Example usage: ${name} [command]`);\n console.log(`Run \"${name} --help\" for more information.`);\n exit(ERROR_CODE);\n return;\n }\n\n if (args[0] === 'clear') {\n clear();\n exit(0);\n return;\n }\n\n console.log(`Unrecognized command: ${args[0]}. Example usage: ${name} [command]`);\n console.log(`Run \"${name} --help\" for more information.`);\n exit(ERROR_CODE);\n};\n"],"names":["__dirname","path","dirname","__filename","url","fileURLToPath","ERROR_CODE","getVersion","packageJsonPath","join","packageJson","JSON","parse","fs","readFileSync","version","printHelp","name","console","log","argv","options","getopts","alias","help","boolean","stopEarly","exit","args","_","length","clear"],"mappings":";;;;;+BAiCA;;;eAAA;;;iEA/BiB;yDACF;oEACK;2DACH;0DACD;8DACE;;;;;;AAElB,IAAMA,YAAYC,aAAI,CAACC,OAAO,CAAC,OAAOC,eAAe,cAAcA,aAAaC,YAAG,CAACC,aAAa,CAAC;AAElG,IAAMC,aAAa;AAEnB,SAASC;IACP,IAAMC,kBAAkBP,aAAI,CAACQ,IAAI,CAACT,WAAW,MAAM,MAAM;IACzD,IAAMU,cAAcC,KAAKC,KAAK,CAACC,WAAE,CAACC,YAAY,CAACN,iBAAiB;IAChE,OAAOE,YAAYK,OAAO;AAC5B;AAEA,SAASC,UAAUC,IAAY;IAC7B,IAAMF,UAAUR;IAChBW,QAAQC,GAAG,CAAC,AAAC,GAAWJ,OAATE,MAAK,MAAY,OAARF;IACxBG,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC,AAAC,UAAc,OAALF,MAAK;IAC3BC,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;AACd;IAEA,WAAe,SAACC,MAAgBH;IAC9BA,OAAOA,QAAQ;IACf,IAAMI,UAAUC,IAAAA,sBAAO,EAACF,MAAM;QAC5BG,OAAO;YAAER,SAAS;YAAKS,MAAM;QAAI;QACjCC,SAAS;YAAC;YAAW;SAAO;QAC5BC,WAAW;IACb;IAEA,IAAIL,QAAQN,OAAO,EAAE;QACnBG,QAAQC,GAAG,CAACZ;QACZoB,IAAAA,mBAAI,EAAC;QACL;IACF;IAEA,IAAIN,QAAQG,IAAI,EAAE;QAChBR,UAAUC;QACVU,IAAAA,mBAAI,EAAC;QACL;IACF;IAEA,IAAMC,OAAOP,QAAQQ,CAAC;IACtB,IAAI,CAACD,KAAKE,MAAM,EAAE;QAChBZ,QAAQC,GAAG,CAAC,AAAC,mCAAuC,OAALF,MAAK;QACpDC,QAAQC,GAAG,CAAC,AAAC,QAAY,OAALF,MAAK;QACzBU,IAAAA,mBAAI,EAACrB;QACL;IACF;IAEA,IAAIsB,IAAI,CAAC,EAAE,KAAK,SAAS;QACvBG,IAAAA,gBAAK;QACLJ,IAAAA,mBAAI,EAAC;QACL;IACF;IAEAT,QAAQC,GAAG,CAAC,AAAC,yBAAmDF,OAA3BW,IAAI,CAAC,EAAE,EAAC,qBAAwB,OAALX,MAAK;IACrEC,QAAQC,GAAG,CAAC,AAAC,QAAY,OAALF,MAAK;IACzBU,IAAAA,mBAAI,EAACrB;AACP"} |
@@ -6,3 +6,5 @@ import type { InstallCallback, InstallOptions } from './types.js'; | ||
| export type * from './types.js'; | ||
| export default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions | InstallCallback, callback?: InstallCallback): undefined | Promise<string>; | ||
| export default function installModule(installString: string, nodeModulesPath: string, callback: InstallCallback): void; | ||
| export default function installModule(installString: string, nodeModulesPath: string, options: InstallOptions, callback: InstallCallback): void; | ||
| export default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions): Promise<string>; | ||
| export declare function sync(installString: string, nodeModulesPath: string, options?: InstallOptions): string | undefined; |
@@ -6,3 +6,5 @@ import type { InstallCallback, InstallOptions } from './types.js'; | ||
| export type * from './types.js'; | ||
| export default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions | InstallCallback, callback?: InstallCallback): undefined | Promise<string>; | ||
| export default function installModule(installString: string, nodeModulesPath: string, callback: InstallCallback): void; | ||
| export default function installModule(installString: string, nodeModulesPath: string, options: InstallOptions, callback: InstallCallback): void; | ||
| export default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions): Promise<string>; | ||
| export declare function sync(installString: string, nodeModulesPath: string, options?: InstallOptions): string | undefined; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/install-module-linked/src/index.ts"],"sourcesContent":["import type { InstallCallback, InstallOptions } from './types.ts';\nimport worker from './workers/async.ts';\nimport workerSync from './workers/sync.ts';\n\nexport { default as clear } from './lib/clear.ts';\nexport { default as install } from './lib/install.ts';\nexport { default as parseInstallString } from './lib/parseInstallString.ts';\nexport type * from './types.ts';\n\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions | InstallCallback, callback?: InstallCallback): undefined | Promise<string> {\n if (typeof options === 'function') {\n callback = options as InstallCallback;\n options = {};\n }\n options = options || {};\n\n if (typeof callback === 'function') return worker(installString, nodeModulesPath, options, callback) as undefined;\n return new Promise((resolve, reject) => worker(installString, nodeModulesPath, options, (err, dest) => (err ? reject(err) : resolve(dest))));\n}\n\nexport function sync(installString: string, nodeModulesPath: string, options?: InstallOptions): string | undefined {\n options = options || {};\n return workerSync(installString, nodeModulesPath, options);\n}\n"],"names":["clear","installModule","install","parseInstallString","sync","installString","nodeModulesPath","options","callback","worker","Promise","resolve","reject","err","dest","workerSync"],"mappings":";;;;;;;;;;;QAIoBA;eAAAA,gBAAK;;QAKzB;eAAwBC;;QAJJC;eAAAA,kBAAO;;QACPC;eAAAA,6BAAkB;;QActBC;eAAAA;;;8DAnBG;6DACI;8DAEU;gEACE;2EACW;;;;;;AAG/B,SAASH,cAAcI,aAAqB,EAAEC,eAAuB,EAAEC,OAA0C,EAAEC,QAA0B;IAC1J,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IAEtB,IAAI,OAAOC,aAAa,YAAY,OAAOC,IAAAA,gBAAM,EAACJ,eAAeC,iBAAiBC,SAASC;IAC3F,OAAO,IAAIE,QAAQ,SAACC,SAASC;eAAWH,IAAAA,gBAAM,EAACJ,eAAeC,iBAAiBC,SAAS,SAACM,KAAKC;mBAAUD,MAAMD,OAAOC,OAAOF,QAAQG;;;AACtI;AAEO,SAASV,KAAKC,aAAqB,EAAEC,eAAuB,EAAEC,OAAwB;IAC3FA,UAAUA,WAAW,CAAC;IACtB,OAAOQ,IAAAA,eAAU,EAACV,eAAeC,iBAAiBC;AACpD"} | ||
| {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/install-module-linked/src/index.ts"],"sourcesContent":["import type { InstallCallback, InstallOptions } from './types.ts';\nimport worker from './workers/async.ts';\nimport workerSync from './workers/sync.ts';\n\nexport { default as clear } from './lib/clear.ts';\nexport { default as install } from './lib/install.ts';\nexport { default as parseInstallString } from './lib/parseInstallString.ts';\nexport type * from './types.ts';\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 if (typeof options === 'function') {\n callback = options as InstallCallback;\n options = {};\n }\n options = options || {};\n\n if (typeof callback === 'function') return worker(installString, nodeModulesPath, options, callback);\n return new Promise((resolve, reject) => worker(installString, nodeModulesPath, options as InstallOptions, (err, dest) => (err ? reject(err) : resolve(dest))));\n}\n\nexport function sync(installString: string, nodeModulesPath: string, options?: InstallOptions): string | undefined {\n options = options || {};\n return workerSync(installString, nodeModulesPath, options);\n}\n"],"names":["clear","installModule","install","parseInstallString","sync","installString","nodeModulesPath","options","callback","worker","Promise","resolve","reject","err","dest","workerSync"],"mappings":";;;;;;;;;;;QAIoBA;eAAAA,gBAAK;;QAQzB;eAAwBC;;QAPJC;eAAAA,kBAAO;;QACPC;eAAAA,6BAAkB;;QAiBtBC;eAAAA;;;8DAtBG;6DACI;8DAEU;gEACE;2EACW;;;;;;AAM/B,SAASH,cAAcI,aAAqB,EAAEC,eAAuB,EAAEC,OAA0C,EAAEC,QAA0B;IAC1J,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IAEtB,IAAI,OAAOC,aAAa,YAAY,OAAOC,IAAAA,gBAAM,EAACJ,eAAeC,iBAAiBC,SAASC;IAC3F,OAAO,IAAIE,QAAQ,SAACC,SAASC;eAAWH,IAAAA,gBAAM,EAACJ,eAAeC,iBAAiBC,SAA2B,SAACM,KAAKC;mBAAUD,MAAMD,OAAOC,OAAOF,QAAQG;;;AACxJ;AAEO,SAASV,KAAKC,aAAqB,EAAEC,eAAuB,EAAEC,OAAwB;IAC3FA,UAAUA,WAAW,CAAC;IACtB,OAAOQ,IAAAA,eAAU,EAACV,eAAeC,iBAAiBC;AACpD"} |
| #!/usr/bin/env node | ||
| declare const _default: (argv: string[], name?: string) => undefined; | ||
| declare const _default: (argv: string[], name?: string) => void; | ||
| export default _default; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/install-module-linked/src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport exit from 'exit-compat';\nimport fs from 'fs';\nimport getopts from 'getopts-compat';\nimport path from 'path';\nimport url from 'url';\nimport clear from './lib/clear.ts';\n\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\n\nconst ERROR_CODE = 7;\n\nfunction getVersion(): string {\n const packageJsonPath = path.join(__dirname, '..', '..', 'package.json');\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));\n return packageJson.version;\n}\n\nfunction printHelp(name: string): void {\n const version = getVersion();\n console.log(`${name} v${version}`);\n console.log('');\n console.log(`Usage: ${name} [options] [command]`);\n console.log('');\n console.log('Commands:');\n console.log(' clear Clear the module cache');\n console.log('');\n console.log('Options:');\n console.log(' -v, --version Print version number');\n console.log(' -h, --help Print this help message');\n}\n\nexport default (argv: string[], name?: string): undefined => {\n name = name || 'iml';\n const options = getopts(argv, {\n alias: { version: 'v', help: 'h' },\n boolean: ['version', 'help'],\n stopEarly: true,\n });\n\n if (options.version) {\n console.log(getVersion());\n exit(0);\n return;\n }\n\n if (options.help) {\n printHelp(name);\n exit(0);\n return;\n }\n\n const args = options._;\n if (!args.length) {\n console.log(`Missing command. Example usage: ${name} [command]`);\n console.log(`Run \"${name} --help\" for more information.`);\n exit(ERROR_CODE);\n return;\n }\n\n if (args[0] === 'clear') {\n clear();\n exit(0);\n return;\n }\n\n console.log(`Unrecognized command: ${args[0]}. Example usage: ${name} [command]`);\n console.log(`Run \"${name} --help\" for more information.`);\n exit(ERROR_CODE);\n};\n"],"names":["exit","fs","getopts","path","url","clear","__dirname","dirname","__filename","fileURLToPath","ERROR_CODE","getVersion","packageJsonPath","join","packageJson","JSON","parse","readFileSync","version","printHelp","name","console","log","argv","options","alias","help","boolean","stopEarly","args","_","length"],"mappings":";AAEA,OAAOA,UAAU,cAAc;AAC/B,OAAOC,QAAQ,KAAK;AACpB,OAAOC,aAAa,iBAAiB;AACrC,OAAOC,UAAU,OAAO;AACxB,OAAOC,SAAS,MAAM;AACtB,OAAOC,WAAW,iBAAiB;AAEnC,MAAMC,YAAYH,KAAKI,OAAO,CAAC,OAAOC,eAAe,cAAcA,aAAaJ,IAAIK,aAAa,CAAC,YAAYL,GAAG;AAEjH,MAAMM,aAAa;AAEnB,SAASC;IACP,MAAMC,kBAAkBT,KAAKU,IAAI,CAACP,WAAW,MAAM,MAAM;IACzD,MAAMQ,cAAcC,KAAKC,KAAK,CAACf,GAAGgB,YAAY,CAACL,iBAAiB;IAChE,OAAOE,YAAYI,OAAO;AAC5B;AAEA,SAASC,UAAUC,IAAY;IAC7B,MAAMF,UAAUP;IAChBU,QAAQC,GAAG,CAAC,GAAGF,KAAK,EAAE,EAAEF,SAAS;IACjCG,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC,CAAC,OAAO,EAAEF,KAAK,oBAAoB,CAAC;IAChDC,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;AACd;AAEA,eAAe,CAAA,CAACC,MAAgBH;IAC9BA,OAAOA,QAAQ;IACf,MAAMI,UAAUtB,QAAQqB,MAAM;QAC5BE,OAAO;YAAEP,SAAS;YAAKQ,MAAM;QAAI;QACjCC,SAAS;YAAC;YAAW;SAAO;QAC5BC,WAAW;IACb;IAEA,IAAIJ,QAAQN,OAAO,EAAE;QACnBG,QAAQC,GAAG,CAACX;QACZX,KAAK;QACL;IACF;IAEA,IAAIwB,QAAQE,IAAI,EAAE;QAChBP,UAAUC;QACVpB,KAAK;QACL;IACF;IAEA,MAAM6B,OAAOL,QAAQM,CAAC;IACtB,IAAI,CAACD,KAAKE,MAAM,EAAE;QAChBV,QAAQC,GAAG,CAAC,CAAC,gCAAgC,EAAEF,KAAK,UAAU,CAAC;QAC/DC,QAAQC,GAAG,CAAC,CAAC,KAAK,EAAEF,KAAK,8BAA8B,CAAC;QACxDpB,KAAKU;QACL;IACF;IAEA,IAAImB,IAAI,CAAC,EAAE,KAAK,SAAS;QACvBxB;QACAL,KAAK;QACL;IACF;IAEAqB,QAAQC,GAAG,CAAC,CAAC,sBAAsB,EAAEO,IAAI,CAAC,EAAE,CAAC,iBAAiB,EAAET,KAAK,UAAU,CAAC;IAChFC,QAAQC,GAAG,CAAC,CAAC,KAAK,EAAEF,KAAK,8BAA8B,CAAC;IACxDpB,KAAKU;AACP,CAAA,EAAE"} | ||
| {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/install-module-linked/src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport exit from 'exit-compat';\nimport fs from 'fs';\nimport getopts from 'getopts-compat';\nimport path from 'path';\nimport url from 'url';\nimport clear from './lib/clear.ts';\n\nconst __dirname = path.dirname(typeof __filename !== 'undefined' ? __filename : url.fileURLToPath(import.meta.url));\n\nconst ERROR_CODE = 7;\n\nfunction getVersion(): string {\n const packageJsonPath = path.join(__dirname, '..', '..', 'package.json');\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));\n return packageJson.version;\n}\n\nfunction printHelp(name: string): void {\n const version = getVersion();\n console.log(`${name} v${version}`);\n console.log('');\n console.log(`Usage: ${name} [options] [command]`);\n console.log('');\n console.log('Commands:');\n console.log(' clear Clear the module cache');\n console.log('');\n console.log('Options:');\n console.log(' -v, --version Print version number');\n console.log(' -h, --help Print this help message');\n}\n\nexport default (argv: string[], name?: string): void => {\n name = name || 'iml';\n const options = getopts(argv, {\n alias: { version: 'v', help: 'h' },\n boolean: ['version', 'help'],\n stopEarly: true,\n });\n\n if (options.version) {\n console.log(getVersion());\n exit(0);\n return;\n }\n\n if (options.help) {\n printHelp(name);\n exit(0);\n return;\n }\n\n const args = options._;\n if (!args.length) {\n console.log(`Missing command. Example usage: ${name} [command]`);\n console.log(`Run \"${name} --help\" for more information.`);\n exit(ERROR_CODE);\n return;\n }\n\n if (args[0] === 'clear') {\n clear();\n exit(0);\n return;\n }\n\n console.log(`Unrecognized command: ${args[0]}. Example usage: ${name} [command]`);\n console.log(`Run \"${name} --help\" for more information.`);\n exit(ERROR_CODE);\n};\n"],"names":["exit","fs","getopts","path","url","clear","__dirname","dirname","__filename","fileURLToPath","ERROR_CODE","getVersion","packageJsonPath","join","packageJson","JSON","parse","readFileSync","version","printHelp","name","console","log","argv","options","alias","help","boolean","stopEarly","args","_","length"],"mappings":";AAEA,OAAOA,UAAU,cAAc;AAC/B,OAAOC,QAAQ,KAAK;AACpB,OAAOC,aAAa,iBAAiB;AACrC,OAAOC,UAAU,OAAO;AACxB,OAAOC,SAAS,MAAM;AACtB,OAAOC,WAAW,iBAAiB;AAEnC,MAAMC,YAAYH,KAAKI,OAAO,CAAC,OAAOC,eAAe,cAAcA,aAAaJ,IAAIK,aAAa,CAAC,YAAYL,GAAG;AAEjH,MAAMM,aAAa;AAEnB,SAASC;IACP,MAAMC,kBAAkBT,KAAKU,IAAI,CAACP,WAAW,MAAM,MAAM;IACzD,MAAMQ,cAAcC,KAAKC,KAAK,CAACf,GAAGgB,YAAY,CAACL,iBAAiB;IAChE,OAAOE,YAAYI,OAAO;AAC5B;AAEA,SAASC,UAAUC,IAAY;IAC7B,MAAMF,UAAUP;IAChBU,QAAQC,GAAG,CAAC,GAAGF,KAAK,EAAE,EAAEF,SAAS;IACjCG,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC,CAAC,OAAO,EAAEF,KAAK,oBAAoB,CAAC;IAChDC,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;IACZD,QAAQC,GAAG,CAAC;AACd;AAEA,eAAe,CAAA,CAACC,MAAgBH;IAC9BA,OAAOA,QAAQ;IACf,MAAMI,UAAUtB,QAAQqB,MAAM;QAC5BE,OAAO;YAAEP,SAAS;YAAKQ,MAAM;QAAI;QACjCC,SAAS;YAAC;YAAW;SAAO;QAC5BC,WAAW;IACb;IAEA,IAAIJ,QAAQN,OAAO,EAAE;QACnBG,QAAQC,GAAG,CAACX;QACZX,KAAK;QACL;IACF;IAEA,IAAIwB,QAAQE,IAAI,EAAE;QAChBP,UAAUC;QACVpB,KAAK;QACL;IACF;IAEA,MAAM6B,OAAOL,QAAQM,CAAC;IACtB,IAAI,CAACD,KAAKE,MAAM,EAAE;QAChBV,QAAQC,GAAG,CAAC,CAAC,gCAAgC,EAAEF,KAAK,UAAU,CAAC;QAC/DC,QAAQC,GAAG,CAAC,CAAC,KAAK,EAAEF,KAAK,8BAA8B,CAAC;QACxDpB,KAAKU;QACL;IACF;IAEA,IAAImB,IAAI,CAAC,EAAE,KAAK,SAAS;QACvBxB;QACAL,KAAK;QACL;IACF;IAEAqB,QAAQC,GAAG,CAAC,CAAC,sBAAsB,EAAEO,IAAI,CAAC,EAAE,CAAC,iBAAiB,EAAET,KAAK,UAAU,CAAC;IAChFC,QAAQC,GAAG,CAAC,CAAC,KAAK,EAAEF,KAAK,8BAA8B,CAAC;IACxDpB,KAAKU;AACP,CAAA,EAAE"} |
@@ -6,3 +6,5 @@ import type { InstallCallback, InstallOptions } from './types.js'; | ||
| export type * from './types.js'; | ||
| export default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions | InstallCallback, callback?: InstallCallback): undefined | Promise<string>; | ||
| export default function installModule(installString: string, nodeModulesPath: string, callback: InstallCallback): void; | ||
| export default function installModule(installString: string, nodeModulesPath: string, options: InstallOptions, callback: InstallCallback): void; | ||
| export default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions): Promise<string>; | ||
| export declare function sync(installString: string, nodeModulesPath: string, options?: InstallOptions): string | undefined; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/install-module-linked/src/index.ts"],"sourcesContent":["import type { InstallCallback, InstallOptions } from './types.ts';\nimport worker from './workers/async.ts';\nimport workerSync from './workers/sync.ts';\n\nexport { default as clear } from './lib/clear.ts';\nexport { default as install } from './lib/install.ts';\nexport { default as parseInstallString } from './lib/parseInstallString.ts';\nexport type * from './types.ts';\n\nexport default function installModule(installString: string, nodeModulesPath: string, options?: InstallOptions | InstallCallback, callback?: InstallCallback): undefined | Promise<string> {\n if (typeof options === 'function') {\n callback = options as InstallCallback;\n options = {};\n }\n options = options || {};\n\n if (typeof callback === 'function') return worker(installString, nodeModulesPath, options, callback) as undefined;\n return new Promise((resolve, reject) => worker(installString, nodeModulesPath, options, (err, dest) => (err ? reject(err) : resolve(dest))));\n}\n\nexport function sync(installString: string, nodeModulesPath: string, options?: InstallOptions): string | undefined {\n options = options || {};\n return workerSync(installString, nodeModulesPath, options);\n}\n"],"names":["worker","workerSync","default","clear","install","parseInstallString","installModule","installString","nodeModulesPath","options","callback","Promise","resolve","reject","err","dest","sync"],"mappings":"AACA,OAAOA,YAAY,qBAAqB;AACxC,OAAOC,gBAAgB,oBAAoB;AAE3C,SAASC,WAAWC,KAAK,QAAQ,iBAAiB;AAClD,SAASD,WAAWE,OAAO,QAAQ,mBAAmB;AACtD,SAASF,WAAWG,kBAAkB,QAAQ,8BAA8B;AAG5E,eAAe,SAASC,cAAcC,aAAqB,EAAEC,eAAuB,EAAEC,OAA0C,EAAEC,QAA0B;IAC1J,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IAEtB,IAAI,OAAOC,aAAa,YAAY,OAAOV,OAAOO,eAAeC,iBAAiBC,SAASC;IAC3F,OAAO,IAAIC,QAAQ,CAACC,SAASC,SAAWb,OAAOO,eAAeC,iBAAiBC,SAAS,CAACK,KAAKC,OAAUD,MAAMD,OAAOC,OAAOF,QAAQG;AACtI;AAEA,OAAO,SAASC,KAAKT,aAAqB,EAAEC,eAAuB,EAAEC,OAAwB;IAC3FA,UAAUA,WAAW,CAAC;IACtB,OAAOR,WAAWM,eAAeC,iBAAiBC;AACpD"} | ||
| {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node/install-module-linked/src/index.ts"],"sourcesContent":["import type { InstallCallback, InstallOptions } from './types.ts';\nimport worker from './workers/async.ts';\nimport workerSync from './workers/sync.ts';\n\nexport { default as clear } from './lib/clear.ts';\nexport { default as install } from './lib/install.ts';\nexport { default as parseInstallString } from './lib/parseInstallString.ts';\nexport type * from './types.ts';\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 if (typeof options === 'function') {\n callback = options as InstallCallback;\n options = {};\n }\n options = options || {};\n\n if (typeof callback === 'function') return worker(installString, nodeModulesPath, options, callback);\n return new Promise((resolve, reject) => worker(installString, nodeModulesPath, options as InstallOptions, (err, dest) => (err ? reject(err) : resolve(dest))));\n}\n\nexport function sync(installString: string, nodeModulesPath: string, options?: InstallOptions): string | undefined {\n options = options || {};\n return workerSync(installString, nodeModulesPath, options);\n}\n"],"names":["worker","workerSync","default","clear","install","parseInstallString","installModule","installString","nodeModulesPath","options","callback","Promise","resolve","reject","err","dest","sync"],"mappings":"AACA,OAAOA,YAAY,qBAAqB;AACxC,OAAOC,gBAAgB,oBAAoB;AAE3C,SAASC,WAAWC,KAAK,QAAQ,iBAAiB;AAClD,SAASD,WAAWE,OAAO,QAAQ,mBAAmB;AACtD,SAASF,WAAWG,kBAAkB,QAAQ,8BAA8B;AAM5E,eAAe,SAASC,cAAcC,aAAqB,EAAEC,eAAuB,EAAEC,OAA0C,EAAEC,QAA0B;IAC1J,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IAEtB,IAAI,OAAOC,aAAa,YAAY,OAAOV,OAAOO,eAAeC,iBAAiBC,SAASC;IAC3F,OAAO,IAAIC,QAAQ,CAACC,SAASC,SAAWb,OAAOO,eAAeC,iBAAiBC,SAA2B,CAACK,KAAKC,OAAUD,MAAMD,OAAOC,OAAOF,QAAQG;AACxJ;AAEA,OAAO,SAASC,KAAKT,aAAqB,EAAEC,eAAuB,EAAEC,OAAwB;IAC3FA,UAAUA,WAAW,CAAC;IACtB,OAAOR,WAAWM,eAAeC,iBAAiBC;AACpD"} |
+2
-2
| { | ||
| "name": "install-module-linked", | ||
| "version": "1.4.3", | ||
| "version": "1.5.0", | ||
| "description": "Installs and symlinks a module into node_modules", | ||
@@ -53,3 +53,3 @@ "keywords": [ | ||
| "dependencies": { | ||
| "cross-spawn-cb": "^2.0.0", | ||
| "cross-spawn-cb": "^3.0.0", | ||
| "exit-compat": "^1.0.0", | ||
@@ -56,0 +56,0 @@ "fs-remove-compat": "^1.0.0", |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
102438
1.38%989
0.41%+ Added
- Removed
Updated