Skip to content

Instantly share code, notes, and snippets.

View mh-mobile's full-sized avatar
🏠
Working from home

mh-mobile mh-mobile

🏠
Working from home
View GitHub Profile
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);
});
const clear = require("clear");
clear();
console.log("hello");
const figlet = require("figlet");
figlet("mh-mobile", function (err, data) {
console.log(data);
});
const Spinner = require("clui").Spinner;
let countdown = new Spinner("Exiting in 5seconds...", [
"⣾",
"⣽",
"⣻",
"⢿",
"⡿",
"⣟",
"⣯",
const ora = require("ora");
const spinner = ora("Loading unicorns").start();
setTimeout(() => {
spinner.color = "yellow";
spinner.text = "Loading rainbows";
}, 1000);
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"));
const meow = require("meow");
const cli = meow(
`
Usage
$ foo <input>
Options
--rainbow, -r Include a rainbow
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);
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);
const argv = require("minimist")(process.argv.slice(2));
console.log(argv);