rman 0.33.0 → 0.33.1
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/cjs/utils/npm-utils.js
CHANGED
|
@@ -9,11 +9,11 @@ class NpmHelper {
|
|
|
9
9
|
constructor(options) {
|
|
10
10
|
this.cwd = options?.cwd || process.cwd();
|
|
11
11
|
}
|
|
12
|
-
async getPackageInfo(packageName) {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
argv
|
|
16
|
-
});
|
|
12
|
+
async getPackageInfo(packageName, options) {
|
|
13
|
+
const argv = ['view', packageName, '--json'];
|
|
14
|
+
if (options?.userconfig)
|
|
15
|
+
argv.push('--userconfig', options.userconfig);
|
|
16
|
+
const x = await (0, exec_js_1.exec)('npm', { cwd: this.cwd, argv });
|
|
17
17
|
if (x && x.stdout) {
|
|
18
18
|
if (x.code && x.stdout.includes('404')) {
|
|
19
19
|
return new PackageNotFoundError('Package ' + packageName + ' not found in repository');
|
package/esm/utils/npm-utils.js
CHANGED
|
@@ -5,11 +5,11 @@ export class NpmHelper {
|
|
|
5
5
|
constructor(options) {
|
|
6
6
|
this.cwd = options?.cwd || process.cwd();
|
|
7
7
|
}
|
|
8
|
-
async getPackageInfo(packageName) {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
argv
|
|
12
|
-
});
|
|
8
|
+
async getPackageInfo(packageName, options) {
|
|
9
|
+
const argv = ['view', packageName, '--json'];
|
|
10
|
+
if (options?.userconfig)
|
|
11
|
+
argv.push('--userconfig', options.userconfig);
|
|
12
|
+
const x = await exec('npm', { cwd: this.cwd, argv });
|
|
13
13
|
if (x && x.stdout) {
|
|
14
14
|
if (x.code && x.stdout.includes('404')) {
|
|
15
15
|
return new PackageNotFoundError('Package ' + packageName + ' not found in repository');
|
package/package.json
CHANGED
|
@@ -7,5 +7,7 @@ export interface NpmOptions {
|
|
|
7
7
|
export declare class NpmHelper {
|
|
8
8
|
cwd: string;
|
|
9
9
|
constructor(options?: NpmOptions);
|
|
10
|
-
getPackageInfo(packageName: string
|
|
10
|
+
getPackageInfo(packageName: string, options?: {
|
|
11
|
+
userconfig?: string;
|
|
12
|
+
}): Promise<any>;
|
|
11
13
|
}
|