项目作者: fluents

项目描述 :
fluent script building
高级语言: JavaScript
项目地址: git://github.com/fluents/script-chain.git
创建时间: 2017-05-03T08:49:02Z
项目社区:https://github.com/fluents/script-chain

开源协议:

下载


📜⛓ script-chain

NPM version
MIT License
fliphub
fluents
Build Status

fluent script building

build scripts to run that are aware of the context; defining NODE_ENV in the subprocess env, after the npm script, at the beginning of a node or lerna script, whether values should be stringified.

📖 documentation

🔬 tests

📦 usage

  1. yarn add script-chain
  2. npm i script-chain --save
  1. const {ScriptFlip} = require('script-chain')

📘 examples

easy

  1. const scripts = new ScriptFlip()
  2. scripts
  3. .add()
  4. .npm('diggy')
  5. .env('magic')
  6. .flag('env.zoolala', 'aoao')
  7. .arg('-e')

monorepo

makes tackling monorepo execution scripts a breeze

  1. const script = new ScriptFlip()
  2. .add()
  3. .env('prod')
  4. .lerna()
  5. .prefix('inferno')
  6. .scope('app1,app2,inferno')
  7. .log('info')
  8. .concurrency(1)
  9. .group(2)
  10. .raw('node')
  11. .flag('row', '0')
  12. .bin('tsc')
  13. script.includes('--scope=+(inferno-app1|inferno-app2|inferno)')

running

will run commands in a subprocess

  1. const scripts = new ScriptFlip()
  2. scripts
  3. .add()
  4. .npm('diggy')
  5. .env('magic')
  6. .flag('env.zoolala', 'aoao')
  7. .arg('-e')
  8. const results = await scripts.run()