projectinfo/dist/index.js

17 lines
2.0 KiB
JavaScript

var projectinfo = {};
//classes
var ProjectinfoNPM = require("./projectinfo.npm");
projectinfo.npm = function (cwdArg, optionsArg) {
return new ProjectinfoNPM(cwdArg, optionsArg);
};
//quick functions
projectinfo.getName = function (cwdArg) {
var localNpm = projectinfo.npm(cwdArg);
if (localNpm.status === "ok") {
return localNpm.name;
}
};
module.exports = projectinfo;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLElBQUksV0FBVyxHQUFPLEVBQUUsQ0FBQztBQUV6QixTQUFTO0FBQ1QsSUFBTyxjQUFjLFdBQVcsbUJBQW1CLENBQUMsQ0FBQztBQUNyRCxXQUFXLENBQUMsR0FBRyxHQUFHLFVBQVMsTUFBTSxFQUFDLFVBQVU7SUFDeEMsTUFBTSxDQUFDLElBQUksY0FBYyxDQUFDLE1BQU0sRUFBQyxVQUFVLENBQUMsQ0FBQztBQUNqRCxDQUFDLENBQUM7QUFFRixpQkFBaUI7QUFDakIsV0FBVyxDQUFDLE9BQU8sR0FBRyxVQUFTLE1BQU07SUFDakMsSUFBSSxRQUFRLEdBQUcsV0FBVyxDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsQ0FBQztJQUN2QyxFQUFFLENBQUMsQ0FBQyxRQUFRLENBQUMsTUFBTSxLQUFLLElBQUksQ0FBQyxDQUFBLENBQUM7UUFDMUIsTUFBTSxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUM7SUFDekIsQ0FBQztBQUNMLENBQUMsQ0FBQztBQVlGLGlCQUFTLFdBQVcsQ0FBQyIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cbmltcG9ydCBwbHVnaW5zID0gcmVxdWlyZSh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