Command line utility to get started easily on MasteryJS, a scalable REST API framework build on top of Hapi and Sequelize.
- Build system for MasteryJS
- PM2 configuration using mastery.run.json file, see PM2 Process File
- Server management including start, stop, reload, scaling a MasteryJS package server
- Monitor MasteryJS processes using PM2 Monitoring
- Ability to speak many languages
Open Command Prompt that you will probably need to run as Administrator. And then, type
npm install -g mastery
sudo npm install -g mastery
Create a new MasteryJS project, cloning/download the latest source from MasteryJS repo.
This command can be executed anywhere.
Usage:
mastery new [destination]
- [destination] is the path where the new project will be.
After that, a wizard will showing and there are some questions to follow.
Turn on MasteryJS directly from the source using babel-node.
This command must be executed inside the root of MasteryJS project.
Usage:
mastery serve -i|--inspect -p|--port <n>
-
-i, --inspect enable Chrome Developer Tools Inspector. This argument is optional.
-
-p, --port <n> enable --debug-brk feature, to debug using any supported IDE. Fill <n> with a port number.
Build a MasteryJS project, this will transform MasteryJS source codes into ES2015 minified codes using babel + uglify. Also, a mastery.run.json file will be created for the PM2 needs. After that, a 'build' directory will exist. You can then deploy this directory.
This command must be executed inside the root of MasteryJS project.
Usage:
mastery build
Start MasteryJS server that has been built before using PM2. By default, the processes spawned are using cluster mode.
This command must be executed inside the build of MasteryJS project.
Usage:
mastery start
Stop MasteryJS server.
This command must be executed inside the build of MasteryJS project.
Usage:
mastery stop
Restart MasteryJS server. This will execute the stop and start commands.
This command must be executed inside the build of MasteryJS project.
Usage:
mastery restart
Launch PM2 Process Monitoring.
This command can be executed anywhere.
Usage:
mastery status
Scale MasteryJS cluster processes length that currently running.
This command must be executed inside the build of MasteryJS project.
Usage:
mastery scale [length]
- [length] is optional. If length is not provided, a question will be prompted to define the length.
Change CLI configuration config.json value and change CLI language as well.
This command can be executed anywhere.
Usage:
mastery conf [key] [value]
- [key] Configuration key to change its value.
- [value] The new configuration value.
Example for changing the CLI language to Indonesian:
mastery conf lang id