smartnpm/ts/smartnpm.classes.npmpackage.ts

42 lines
966 B
TypeScript
Raw Permalink Normal View History

2018-09-01 14:40:42 +00:00
import * as plugins from './smartnpm.plugins';
2017-08-14 15:50:48 +00:00
2019-09-06 14:29:45 +00:00
export class NpmPackage {
2019-09-06 11:22:54 +00:00
public static async createFromFullMetadata(fullMetadata: plugins.packageJson.FullMetadata) {
const npmPackage = new NpmPackage();
Object.assign(npmPackage, fullMetadata);
return npmPackage;
}
// INSTANCE
public name: string = null;
public scope: string = null;
public version: string = null;
public description: string = null;
public keywords: string[] = null;
public date: string;
public license: string;
public links: {
2018-09-01 14:40:42 +00:00
npm: string;
homepage: string;
repository: string;
bugs: string;
2019-09-06 11:22:54 +00:00
};
public author: {
2018-09-01 14:40:42 +00:00
name: 'Lossless GmbH';
2019-09-06 11:22:54 +00:00
};
public publisher: {
2018-09-01 14:40:42 +00:00
username: 'gitzone';
email: 'npm@git.zone';
2019-09-06 11:22:54 +00:00
};
public maintainers: any = null;
public score: {
2018-09-01 14:40:42 +00:00
final: number;
2017-08-15 15:03:21 +00:00
detail: {
2018-09-01 14:40:42 +00:00
quality: number;
popularity: number;
maintenance: number;
};
} = null;
2019-09-06 11:22:54 +00:00
public searchScore: number = null;
2017-08-14 15:50:48 +00:00
}