CLI
CLI Screenshot

Install

The CLI can be installed using NPM:
1
npm install @ngxs/cli -g
2
3
# or if you use yarn
4
yarn global add @ngxs/cli
Copied!

Usage

1
ngxs
Copied!

Options (silent)

1
▓█▓▒▒▒▒▒▒▒▒▒▒██░ ▓█▒░░░░░░░░░░░░░ ░▒▒▒▒▒██░ ░██▒▒▒▒▒░ ░██▓▒▒▒▒▒▒▒▒▒▒▒▒░
2
░█░░██████████░░█ ░█░▒█████████████ ░█████░▒█ █▓░█████▒ ██ █████████████▓
3
░█ ▓█ █░░█ ░█ ▓▓ ░█░▒█ █▓░█░ ██ █░
4
░█ ▓█ █░░█ ░█ ▓▓ ░█░▒█░█▓░█░ ██ █░
5
░█ ▓█ █░░█ ░█ ▓▓ ░▓▓▓▓▓▓██ ░█░░▓▓▓░░█░ ▓█ ░▓▓▓▓▓▓▓▓▓███
6
░█ ▓█ █░░█ ░█ ▓▓ ░█████░░█ ░█░░███▒░█░ ▒████████████ █▒
7
░█ ▓█ █░░█ ░█ ▓▓ ░█░░█ ░█░▒█ █▓░█░ ▓█ █▓
8
░█ ▓█ █░░█ ░█ ▓▓ ░█░░█ ░█░▒█ █▓░█░ ▓█ █▓
9
░█ ▓█ █░░█ ░█░░█████████▓ ░█ ░████▓ ▓█ ██ ▓████▒ █████████████▒░█▒
10
░█ ▓█ █░░█ ░███████████████ ░██████▓ ▒██████▒ ███████████████░
11
12
13
14
NGXS CLI
15
16
$ ngxs --name name --spec boolean --directory path --folder-name name
17
$ ngxs --help
18
19
Options
20
21
--name name Store name
22
--directory path By default, the prompt is set to the current directory
23
--folder-name name Use your own folder name, default: state
24
--spec boolean Creates a spec file for store, default: true
25
26
Custom template generator
27
28
--plopfile path Path to the plopfile
Copied!

What is Plop?

Plop is what I like to call a "micro-generator framework." Now, I call it that because it is a small tool that gives you a simple way to generate code or any other type of flat text files in a consistent way. You see, we all create structures and patterns in our code (routes, controllers, components, helpers, etc). These patterns change and improve over time so when you need to create a NEW insert-name-of-pattern-here, it's not always easy to locate the files in your codebase that represent the current "best practice." That's where plop saves you. With plop, you have your "best practice" method of creating any given pattern in CODE. Code that can easily be run from the terminal by typing plop. Not only does this save you from hunting around in your codebase for the right files to copy, but it also turns "the right way" into "the easiest way" to make new files.
Last modified 1yr ago