Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
gear is a scriptable build system using simple tasks that act like a sequence of piped commands.
Features include:
To get the most out of gear, you will want to install gear-lib which contains tasks for linting, minifying, and deploying JS/CSS assets.
npm install gear
npm install gear-lib
gear.queue()
.load('foo.js')
.log('read foo.js')
.inspect()
.write('foobarbaz.js')
.run();
gear.queue()
.load(['foo.js', {file: 'bar.js'}, 'baz.js'])
.log('read foo.js')
.inspect()
.write(['newfoo.js', 'newbar.js']) // Not writing 'baz.js'
.run();
gear.queue()
.load('foo.js')
.log('Complex Task')
.tasks({
read: {task: 'load', options: ['foo.js', 'bar.js', 'baz.js'], callback: function(err, results) {}}
combine: {task: 'concat', requires: ['read']}
minify: {task: 'jsminify', requires: ['combine']}
print: {task: 'inspect', requires: ['read', 'combine', 'minify']} // Runs when read, combine, and minify complete
parallel: {task: 'log', options: "Hello gear world!"} // Run parallel to read
}).run();
Creates a new Queue instance.
Arguments
Example
gear.queue()
.log('test')
.run();
Runs the specified task.
Arguments
Example
gear.queue()
.task('log', 'Hello, world!')
.run();
Runs the queue.
Example
gear.queue()
.log('test')
.run();
Creates a new Registry instance.
Example
gear.registry();
Load from NPM, directory, or file.
Arguments
Example
gear.registry().load({dirname: 'foo'});
Loads messages from different sources.
Arguments
Example
// source - Filename or object to load.
// source.file - Filename of resource.
.load(['foo', 'baz'])
.load([{file: 'foo'}, {file: 'bar'}, {file: 'baz'}])
Arguments
Write the message to disk.
Example
.write({file: 'foo'})
Concatenates messages.
Example
.concat()
Inspects a message.
Example
.inspect()
Arguments
Log a message.
Example
.log('Finished')
Arguments
Execute tasks in parallel with optional dependencies. Data is joined on completion.
Example
// label - Task instance name.
// label.task - Task name.
// label.options - Task options.
// label.requires - List of labels that must be executed before this task runs.
.tasks({
label_1: {task: 'log', options: 'Hello, world!'}
label_2: {task: 'log', options: 'Hello, world 2!', requires: ['label_1']}
})
## Library Tasks
Install gear-lib which contains tasks such as:
npm install gear-lib
## Custom Tasks
Writing a task is especially easy compared to other Node build systems. There is no need to use gear internals within a task. Tasks operate on immutable messages. Messages have a body property. The task returns transformed data via its callback.
Arguments
Example
// example.js
// Example task replaces each message body with a string.
exports.example = function(string, message, done) {
done(null, {body: string});
};
Running Example Task
gear.queue({registry: gear.registry({filename: 'example.js'})})
.example('EXAMPLE')
.run();
gear takes inspiration from a few sources:
FAQs
Gear.js - Build System for Node.js and the Browser
The npm package gear receives a total of 14,914 weekly downloads. As such, gear popularity was classified as popular.
We found that gear demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.