UNPKG

type-gene

Version:

Typescript Type Generator

23 lines (22 loc) 814 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TsAutoInstall = void 0; const shellJs = require("shelljs"); class TsAutoInstall { static getInstance() { if (!this.instance) this.instance = new TsAutoInstall(); return this.instance; } setTsModule(installOption) { // "D" , "G" , "N" let installOpt = installOption === "N" ? "--save" : "-" + installOption; shellJs.exec(`npm i typescript ${installOpt}`); shellJs.exec(`npm i @types/node ${installOpt}`); shellJs.exec(`npm i @types/express ${installOpt}`); shellJs.exec(`npm i ts-node ${installOpt}`); } } exports.TsAutoInstall = TsAutoInstall; exports.default = TsAutoInstall.getInstance(); module.exports = TsAutoInstall.getInstance();