Q
Q
quiplunar2020-05-06 15:09:59
Node.js
quiplunar, 2020-05-06 15:09:59

How to create npm commands like in angular ng g?

Hello!

You need to implement the command as in the angular cli: ng gc - that is, the command creates all the necessary files in the selected directory and prescribes connections.

In which direction should you dig?)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Shvets, 2020-05-06
@quiplunar

ng g is Schematics and is quite hard to master.
You need a scaffolder, some kind of yeoman or plop

V
Vladimir Korotenko, 2020-05-06
@firedragon

Apparently, look at modules that return the current directory, command line arguments, and possibly some kind of template engine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question