This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const shell = require("shelljs"); | |
console.log(shell.which("git")); | |
console.log(shell.cat("package.json")); | |
shell.cp("package.json", "package-copy.json"); | |
shell.ls("./*.js").forEach(function (file) { | |
console.log(file); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const clear = require("clear"); | |
clear(); | |
console.log("hello"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const figlet = require("figlet"); | |
figlet("mh-mobile", function (err, data) { | |
console.log(data); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Spinner = require("clui").Spinner; | |
let countdown = new Spinner("Exiting in 5seconds...", [ | |
"⣾", | |
"⣽", | |
"⣻", | |
"⢿", | |
"⡿", | |
"⣟", | |
"⣯", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ora = require("ora"); | |
const spinner = ora("Loading unicorns").start(); | |
setTimeout(() => { | |
spinner.color = "yellow"; | |
spinner.text = "Loading rainbows"; | |
}, 1000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const chalk = require("chalk"); | |
console.log(chalk.blue("hello") + " world" + chalk.red("!")); | |
console.log(chalk.blue.bgRed.bold("Hello World")); | |
console.log(chalk.red("hello"), chalk.underline.bgBlue("world")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const meow = require("meow"); | |
const cli = meow( | |
` | |
Usage | |
$ foo <input> | |
Options | |
--rainbow, -r Include a rainbow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program | |
.command("clone <source> [destination]") | |
.description("clone a repository into a newly created directory") | |
.action((source, destination) => { | |
console.log("clone command called"); | |
}); | |
program.version("0.1.0").parse(process.argv); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cli = require("cac")(); | |
cli.option("--type [type]", "Choose a project type", { | |
default: "node", | |
}); | |
cli.option("--name <name>", "Provide yoru name"); | |
cli.command("lint [...files]", "Lint files").action((files, options) => { | |
console.log(files, options); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const argv = require("minimist")(process.argv.slice(2)); | |
console.log(argv); |