Scaffold out Files and Projects from Templates in a Node.js CLI

Share this video with your friends

Send Tweet

One of the killer apps of CLIs is with templating (or scaffolding). The rails generate and ng generate commands are famous for this. By immediately reducing the pain of boilerplate, you can also make it easy to write standardized code, with in-place reminders for comments and developer warnings (it is easier to delete generated code than write code, though of course one can overdo it). There is no standardized tooling for doing scaffolding, since you can use everything from the Express.js templating languages to writing your own, but we explore this problem space with the tiny copy-template-dir library to prove out the developer experience of adding scaffolding to your CLI.

Ron
Ron
~ 5 years ago

Hi Shawn, just saw your cheetsheet in your github, and find out actually commander is a more popular repo, asking could you compare those with oclif? thanks.