2.0.0 • Published 7 years ago

trip v2.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

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

2.0.0

7 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.0

8 years ago

0.8.5

8 years ago

0.8.4

8 years ago

0.8.3

8 years ago

0.8.2

8 years ago

0.8.1

8 years ago

0.0.1

8 years ago

0.8.0

9 years ago

0.7.0

9 years ago

0.6.0

9 years ago

0.5.0

9 years ago

0.4.3

10 years ago

0.4.2

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago

0.0.1-alpha.2

10 years ago

0.0.1-alpha.1

10 years ago