Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
0d3292dd1e | |||
54db436174 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartnpm",
|
"name": "@pushrocks/smartnpm",
|
||||||
"version": "1.0.13",
|
"version": "1.0.14",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartnpm",
|
"name": "@pushrocks/smartnpm",
|
||||||
"version": "1.0.13",
|
"version": "1.0.14",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "interface with npm to retrieve package information",
|
"description": "interface with npm to retrieve package information",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import * as plugins from './smartnpm.plugins';
|
import * as plugins from './smartnpm.plugins';
|
||||||
|
import { NpmRegistry } from './smartnpm.classes.npmregistry';
|
||||||
|
|
||||||
export class NpmPackage {
|
export class NpmPackage {
|
||||||
public static async createFromFullMetadata(fullMetadata: plugins.packageJson.FullMetadata) {
|
public static async createFromFullMetadata(npmRegistry: NpmRegistry, fullMetadata: plugins.packageJson.FullMetadata) {
|
||||||
const npmPackage = new NpmPackage();
|
const npmPackage = new NpmPackage();
|
||||||
Object.assign(npmPackage, fullMetadata);
|
Object.assign(npmPackage, fullMetadata);
|
||||||
return npmPackage;
|
return npmPackage;
|
||||||
|
@ -30,7 +30,7 @@ export class NpmRegistry {
|
|||||||
registryUrl: this.options.npmRegistryUrl,
|
registryUrl: this.options.npmRegistryUrl,
|
||||||
fullMetadata: true
|
fullMetadata: true
|
||||||
});
|
});
|
||||||
const npmPackage = await NpmPackage.createFromFullMetadata(fullMetadata);
|
const npmPackage = await NpmPackage.createFromFullMetadata(this, fullMetadata);
|
||||||
return npmPackage;
|
return npmPackage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user