@proerd/buildscript

1.1.1 • Public • Published

buildscript-utils

(just a couple functions, not proper for general consumption)

runTask(tasksDef : { [taskName] : () => Promise|void })

The task runner. Provide and object which keys will be the task names.

//build.js
var tasks = {
  bundle() {
    return doSomething()
  }
}
buildscript.runTask(tasks)
//call in console:
//node build bundle

spawn( command, opts ) : Promise

let { cwd, processCb, silent, silentInfo } = opts

Spawns a CLI tool.

processCb Callback which provides the created process object. You are not supposed to use this unless you want to -- say -- programatically send input or kill the process.

var tasks = {
  watch() {
    bs.spawn("../node_modules/.bin/tsc -w")
    bs.spawn("../node_modules/.bin/livereload")
  }
}
bs.runTask(tasks)

copyFn( srcglob, dest ) : Promise

Copies a glob of files to a destination, flattening the output tree. To copy a folder without flattening, use spawn('rsync ...') instead.

watch(targetGlob, cb)

Watch a folder using chokidar.

Readme

Keywords

none

Package Sidebar

Install

npm i @proerd/buildscript

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

98.6 kB

Total Files

7

Last publish

Collaborators

  • wkrueger128