When comparing Pint vs NPM, the Slant community recommends NPM for most people. In the question“What are the best Node.js build systems / task runners?” NPM is ranked 3rd while Pint is ranked 7th. The most important reason people chose NPM is:
NPM is compatible with any CLI the developer wants to use.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Uncertainties integration
Transparently handles calculations with quantities with uncertainties (like 3.14±0.01) meter via the uncertainties package.
Pro Supports both Python 2 and Python 3
A single codebase that runs unchanged in Python 2.7+ and Python 3.0+.
Pro NumPy compatibility
It supports a lot of numpy mathematical operations without monkey patching or wrapping numpy.
Pro Supports any numerical type
Supports fraction, float, decimal, numpy.ndarray, etc.
Pro Uses jobs to prevent bloated build files
Using Grunt in complex projects can lead to extremely bloated build files. Pint resolves this issue by introducing Jobs, a job is basically a set of Grunt tasks that are related to a particular build step. Using this method the build code remains organized in different job files, for example one for js compilation and one for CSS preprocessing. When the build process is started, Pint starts running these job files which in turn build the project.
Here's a sample Pintfile.js
further demonstrating the concept of jobs in PintJS.
Pro Faster builds with built-in concurrency
Every job in a build process may depend on something before it. A simple example would be copying of the minified files to the dist directory, this task needs to be performed after the compilation is complete. What Pint does is that it lets the user declare the dependencies within each job in a dependsOn
array. Hence whenever PintJS starts the build process it first generates an internal dependency model so that the build could be parallelized by spawning up new Grunt processes wherever possible resulting in the complete build process being concurrent (and really fast!).
Pro Takes advantage of Grunt's huge plugin ecosystem
Pint is built on Grunt, so it can use Grunt's plugins. Grunt has a plugin for pretty much any need with over 4000 plugins currently available.
Pro Simplified build lifecycle
In some projects there are tasks that aren't related to the build at all. These can be simple tasks such as pulling the GIT SHA or reading the package.json file into variables. With Pint these additional tasks can be defined in the build file too. This is made possible by providing users with an initializr and a finalizr; inside the initialize
callback, tasks such as generation of a list of test files or reading the package.json file can be defined, while in the finalize
callback users can define moving of the build files or pushing the source maps to their server.
Pro Compatible with any CLI
NPM is compatible with any CLI the developer wants to use.
Pro Plenty of helpful NPM modules/plugins
NPM has a strong community that has developed plenty of libraries and plugins that are useful to developers.
Pro Very concise configuration
NPM scripts require fewer lines of code to run a given task. This is true even when it's for running build processes. Using Unix pipes lots of tasks can be reduced to one-liners.
Pro Does not need any wrapper modules
With other task runners, you need to install wrapper modules for tools you may already have installed. When using NPM that's not necessary, to use the tools you need, just install them directly through NPM.
Pro Part of node.js distribution
Pro You're most likely using NPM already
Pro Uncomplicated package management system
When it works...
Cons
Con Potentially unsupported
No activity on repo in 2 years as of Oct 2015
Con Configuration files are bloated and long
Pint's configuration files are the same as Grunt's. Meaning that they are long and hard to read, especially for new users.
Con Custom tasks require additional keyword 'run'
Only a few standard tasks support being executed without the run
keyword (e.g., npm start
vs npm run customtask
)
Con Not a build system, only a task runner
It is supposed to be used for running gulp, webpack or whatever. But it is not supposed to be used as a build system.
Con Passing parameters is awkward
In order to pass additional parameters to npm you must add them after --
(e.g., npm run build -- --custom='foo'
).
Con Badly documented
Less than bare minimum official documentation leaves users in the dark without taking often expensive external courses. Even the --help text has unpluggable gaps. One official source notes the documentation isn't adequate yet nothing has been done to fix this.
Con Lot of issues with authentication and random node problems
Unable to recover from common depencies conflicts consistantly. Error messages are not always helpful to debugging. Doesn't account well for users with different versions of node.
Con Does not run well with Windows
Since a lot of projects that use NPM as a build tool most of the time make use of Bash scripts as well. This means that open source projects that run the command npm run
may run into issues when used in a Windows environment.
Con Doesn't allow you to create build process with complicated logic on its own
In complex heterogeneous app you will quickly migrate to gulp, webpack or whatever leaving to NPM only simple task running responsibility.