jsmake
v0.3.0
Published
JavaScript task tool, similar to Jake, Make or Rake
Downloads
70
Maintainers
Readme
jsmake
What is the jsmake?
jsmake is a task tool which runs user-defined tasks declared in makefile.js
.
In other words, if you execute some commands or code to accomplish some tasks on your codebase, jsmake is the right tool to do it.
With the help of jsmake, project folder oriented tasks such as building sources, refactoring configuration files, deploying project on cloud can be done easily.
As a task tool it offers,
- Tasks with prerequisites,
- Tasks own descriptions and parameters,
- Async task execution with Promises,
- Developer-friendly API to be used as a library,
- Powerful command line argument parsing,
- Utility methods for various tasks such as glob, recursively delete directories or bump version in package.json,
- Environment variables handling (even in Windows),
- Event subscription for tasks and execution queues,
jsmake vs Build Tools
jsmake is not a substitution for "build tools" like gulp.js. Apart from them, jsmake only concentrates on executing shell commands or user directives coded in JavaScript. So there are no pipelines, streams or plugins to be added as a dependency in package.json
.
Instead, jsmake is a complementary product for build tools. For example, it can interoperate with tools like gulp.js.
Quick Start
Execute npm install jsmake -g
to install jsmake on your system.
After installing jsmake, makefile.js
needs to be created at the root of your codebase.
Sample makefile.js
A sample makefile.js
look like:
jsmake.desc('Says hi to someone.');
jsmake.task('hello', function (argv) {
console.log('hi ' + argv.name);
});
Other samples can be found in samples/ folder, such as:
- Alternative syntax
- API
- Async/Promises
- Events
- NPM Utils
- Pre/Post Tasks
- Sequential Tasks
- Shell Commands
- Tasks with Descriptions
- Tasks with Parameters
- Using with gulp.js
Getting Help and List of Tasks
Running jsmake
command will execute the task named default
. If there is no task defined as default
, jsmake will display the help message.
Help content consists of usage of jsmake, the list of declared tasks and their parameters and descriptions. These information also can be displayed with jsmake -h
command.
Help output of jsmake's own makefile.js is shown below:
$ jsmake -h
Usage: jsmake [command] [parameters]
Parameters:
--makefile FILE, -f Load tasks from FILE
--tasks, -t Lists defined tasks
--verbosity Sets verbosity of log messages [debug, warn, info, error]
--version, -v Displays the jsmake version
--help, -h, -? Displays this help message
Tasks Description
------------------------------- -----------------------------------
bump Bumps the package version for next release.
Parameters:
--type Increment type [major, minor, patch, premajor, preminor, prepatch or prerelease]
publish Publishes package to npm.
deps Reinstalls dependencies from npm.
build Builds the source code.
Todo List
See GitHub Projects for more.
Requirements
- node.js (https://nodejs.org/)
License
Apache 2.0, for further details, please see LICENSE file
Contributing
See contributors.md
It is publicly open for any contribution. Bugfixes, new features and extra modules are welcome.
- To contribute to code: Fork the repo, push your changes to your fork, and submit a pull request.
- To report a bug: If something does not work, please report it using GitHub Issues.