Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
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([{file: 'foo.js'}, {file: 'bar.js'}, {file: 'baz.js'}]
.concat()
.write({file: 'foobarbaz.js'})
.run();
gear.queue()
.load([{file: 'foo.js'}])
.log('Complex Task')
.fork({
read: {task: 'load', options: [{file: 'foo.js'}, {file: 'bar.js'}, {file: 'baz.js'}]}
combine: {task: 'concat', requires: ['read']}
output: {task: 'jsminify', requires: ['combine']}
print: {task: 'inspect', requires: ['read', 'combine', 'output']}
}).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 - What resource to load.
// source.file - Filename of resource.
.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
Fork execution into parallel tasks with optional dependencies. Data is joined on fork 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.
.fork({
label_1: {task: 'log', options: 'Hello, world!'}
label_2: {task: 'log', options: 'Hello, world 2!', requires: ['label_1']}
})
## 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 5,720 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.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.