projectinfo/dist/projectinfo.classes.npm.js

23 lines
3.2 KiB
JavaScript

"use strict";
require("typings-global");
var plugins = require("./projectinfo.plugins");
var ProjectinfoNpm = (function () {
function ProjectinfoNpm(cwdArg, optionsArg) {
if (optionsArg === void 0) { optionsArg = {}; }
this.packageJson = plugins.smartfile.local.toObjectSync(plugins.path.join(plugins.path.resolve(cwdArg), "package.json"), "json");
this.name = this.packageJson.name;
this.version = this.packageJson.version;
this.status = "ok";
this.license = this.packageJson.license;
if (this.packageJson.repository) {
this.git = new plugins.smartstring.GitRepo(this.packageJson.repository.url, optionsArg.gitAccessToken);
}
;
}
;
return ProjectinfoNpm;
}());
exports.ProjectinfoNpm = ProjectinfoNpm;
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByb2plY3RpbmZvLmNsYXNzZXMubnBtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUNQLENBQUMsQ0FEc0I7QUFDdkIsSUFBTyxPQUFPLFdBQVcsdUJBQXVCLENBQUMsQ0FBQztBQUNsRDtJQVFJLHdCQUFZLE1BQWEsRUFBQyxVQUF3QztRQUF4QywwQkFBd0MsR0FBeEMsZUFBd0M7UUFDOUQsSUFBSSxDQUFDLFdBQVcsR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyxZQUFZLENBQ25ELE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUNiLE9BQU8sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQyxFQUM1QixjQUFjLENBQ2pCLEVBQ0QsTUFBTSxDQUNULENBQUM7UUFDRixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQyxXQUFXLENBQUMsSUFBSSxDQUFDO1FBQ2xDLElBQUksQ0FBQyxPQUFPLEdBQUcsSUFBSSxDQUFDLFdBQVcsQ0FBQyxPQUFPLENBQUM7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