When comparing Fly 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 Fly is ranked 13th. 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 Takes advantage of ES6 features
Fly is written to use new ES6 features like generators and promises.
Pro Support for concurrent tasks
Fly supports parallel processing and concurrent tasks via Fly.prototype.start([tasks], { parallel: true })
Pro Smaller build files, with same benefits of a huge one
If it's a fly-
plugin you don't have to require it like you do with every other build tool. Theres no need for wrapper functions for each plugin (aka .pipe()
). If it's a fly-
plugin you just call it directly. The build file get's to the point quickly without adding all the extra fluff. This makes your build file very clean and easy to read!
Pro Very easy to setup
Fly is easy to setup, there are no caveats that you have to know since everything is very intuitive. Also with fly you don't have to repeat your self several times. You just define out what you want and that's it. If it's a fly plugin it will be required automatically without the need for an additional plugin.
Pro Fly plugins are required automatically
If you want to use a Fly plugin in a flyfile, it's automatically required
without needing an additional plugin.
Pro Can run subtasks inside a task
Fly supports running multiple subtasks in a single task without having to create a new one.
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 Limited number of plugins
There's still a very limited number of Fly plugins. This can contribute negatively in development time and energies spent to make a plugin to complete a task for which there's none yet.
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.