startit/eloquentjavascript/my-node-cli/index.js

13 lines
285 B
JavaScript

#!/usr/bin/env node
import { program } from "commander";
program
.version("1.0.0")
.description("My Node cli")
.option("-n, --name <type>", "Add your name")
.action((options) => {
console.log('Hey, ${options.name}!');
});
program.parse(process.argv);