New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gasket

Package Overview
Dependencies
Maintainers
3
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gasket

Preconfigured pipelines for node.js

  • 0.8.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
255
decreased by-80.08%
Maintainers
3
Weekly downloads
 
Created
Source

gasket

Preconfigured pipelines for node.js

$ npm install -g gasket
$ gasket # prints help
$ gasket completion --save # install tab completion

Usage

To setup a pipeline add a gasket section to your package.json

{
  "name": "my-test-app",
  "dependencies" : {
    "transform-uppercase": "^1.0.0"
  },
  "gasket": {
    "example": [
      "echo hello world",
      "transform-uppercase"
    ]
  }
}

To run the above example pipeline simply to the repo and run

$ gasket run example # will print HELLO WORLD

gasket will spawn each command in the pipeline (it supports modules/commands installed via npm) and pipe them together.

If you want to wait for the previous command to finish add null to the pipeline

{
  "gasket": {
    "example": [
      "echo hello world",
      null,
      "echo hello afterwards"
    ]
  }
}

Running the above will print

hello world
hello afterwards

Modules in pipelines

In addition to commands it supports node modules that return streams

{
  "gasket": [
    "echo hello world",
    {"module":"./uppercase.js"}
  ]
}

Where uppercase.js is a file that looks like this

var through = require('through2')
module.exports = function() {
  return through(function(data, enc, cb) {
    cb(null, data.toString().toUpperCase())
  })
}

If your module reads/writes JSON object set json:true in the pipeline. That will make gasket parse newline seperated JSON before parsing the objects to the stream and stringify the output.

Running gasket run main will produce HELLO WORLD

Using gasket.json

If you don't have a package.json file you can add the tasks to a gasket.json file instead

{
  "example": [
    "echo hello world",
    "transform-uppercase"
  ]
}

gasket as a module

You can use gasket as a module as well

var gasket = require('gasket')

var pipelines = gasket({
  example: [
    "echo hello world",
    "transform-uppercase"
  ]
})

pipelines.run('example').pipe(process.stdout)

FAQs

Package last updated on 03 Jul 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc