tdeekens / triggsy

:rocket: Triggers npm and bower installs on dependency changes. :rocket:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

triggsy

Build Status ♦️ Dependency Status ♦️ devDependency Status ♦️ npm version

Triggers npm and bower installs on dependency changes.

NPM

The Idea & Concept

The point in time to run npm i and/or bower i is often unsure and either left to the developer or run on startup of an application. The first might introduce hard to inspect failures as dependencies are out of date on the development machine. The latter slows down the startup of the application.

Triggsy aims to solve those issues by reducing the cost of running an npm i and/or bower i. It takes "snapshots" (SHA hashes) of the dependencies and performs an early exit on the command if dependencies have not changed.

CLI

triggsy <install | i>

Supported package managers are currently npm and bower.

Run triggsy --npm to run an npm i only if dependencies have changed or perform an early exit if not.

You can also run all supported package managers by running triggsy i --all.

Config

The .triggsyrc contains a dependency file mapping to an action.

{
  "npm": {
      "triggers": [
        "package.json",
        "npm-shrinkwrap.json"
      ],
      "commands": ["prune", "i"]
  },
  "bower": {
    "triggers": [
      "bower.json"
    ],
    "commands": ["i"]
  }
}

State

The .triggsy file contains a dependency file mapping to an state.

{
  "package.json": "c219c4dc4b7ff6be7a7090459bc6d06a879a1577",
  "bower.json": "d77ebf68a4b10d3045829accb0d0bd6be996720a"
}

Indicating that the state before running triggsy npm the last time the package.json resolved to c219c4dc4b7ff6be7a7090459bc6d06a879a1577. Whenever hashing the current package.json shows a difference the trigger from the .triggsyrc will be run and the .triggsy state will be updated.

Future Features

Releases

  • 0.0.0 Under development

About

:rocket: Triggers npm and bower installs on dependency changes. :rocket:

License:MIT License


Languages

Language:JavaScript 100.0%