UNPKG

basic-express-app

Version:

simple cli to generate a basic express scaffolding with minimal tmplate

27 lines (23 loc) 502 B
/** @format */ const { exec } = require("child_process") const newCommand = async (command) => { exec(command, (error, stdout, stderr) => { if (error) { const err = `error: ${error.message}` if (err.includes("mkdir")) { console.log("a directory with the same name already exist") return } console.log(error) return } if (stderr) { console.log(`stderr: ${stderr}`) return } // stdout && console.log(`stdout: ${stdout}`) }) } module.exports = { newCommand, }