trip
The minimalist's task runner.
Last updated 3 years ago by callumlocke .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install trip 
SYNC missed versions from official npm registry.

trip

The minimalist's task runner.

NPM version Linux Build Status Windows Build Status Dependency Status devDependency Status peerDependency Status


Install

> yarn global add trip

# or...
> npm install trip -g

Or install it locally inside a project if you prefer.

Usage

  1. Make a tripfile.js and export some functions from it.
  2. Run the named functions from your CLI using trip FUNCTION_NAME.

You can use ES2016 syntax and it will just work.

You can run multiple tasks in series like this: > trip task1 task2 task3

Example tripfile.js

A tripfile is a module that exports some functions:

// > trip speak
export function speak() {
    console.log('Hello world!');
}

// > trip wow
export async function wow() {
    await somePromise();
}

// > trip
export async default function () {
    console.log('this is the default task');
}

Flags

You can pass boolean flags from the command line, using : as a delimiter.

For example, the command > trip foo:bar:baz will call the foo function with the flags { bar: true, baz: true }.

// run this with `trip speak:leaving:polite` to set enable the flag
export function speak({ leaving }) {
    console.log((leaving ? 'Goodbye' : 'Hello') + ' world!');
}

ES2016

Your tripfile is automatically compiled with Babel. Trip uses the env and preset and most stage-0 features by default, so you don't need to bring your own Babel config. But if you do have your own config in a .babelrc or package.json, Babel will use that instead.

Async tasks

Trip understands several kinds of async:

  • async functions
  • functions that return promises
  • functions that return streams
  • functions that explicitly accept a done callback as a second argument (for compatibility with old APIs)

When you run multiple tasks from one command (> trip task1 task2), trip waits for each task to finish before starting the next.

License

MIT © Callum Locke

Current Tags

  • 2.0.0                                ...           latest (3 years ago)

10 Versions

  • 2.0.0                                ...           3 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
  • 0.8.5                                ...           4 years ago
  • 0.8.4                                ...           4 years ago
  • 0.8.3                                ...           4 years ago
  • 0.8.2                                ...           4 years ago
  • 0.8.1                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 10
Dependencies (19)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |