2.0.3 • Published 9 years ago

@carrd/tasks v2.0.3

Weekly downloads
1
License
MIT
Repository
-
Last release
9 years ago

A task runner using ES2015 syntax

It uses babel to compile the code.

Task example

./tasks/echo.js - output the source of the given file

import readFile from 'fs'
import join from 'path'

export default function * (options, run) {
  if (!options.path) {
    return console.error('Missing file path')
  }

  let source = yield (done) => { readFile(options.path, 'utf8', done) }

  console.log(source)
}

Run from terminal:

$ task echo --path=./tasks/echo.js

Run programmatically:

var co = require('co')
var task = require('@card/tasks')


co(function * () {
  yield task('echo', { some: 'options' })
})

Lookup formula

task setup --config=./file.json

  1. looks for a file ./tasks/setup.js
  2. looks for a file ./tasks.js and for an exported function named setup

License MIT

2.0.3

9 years ago

2.0.2

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.3.0

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.0

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago