# script-chain

> fluent script building

Latest version **0.0.9** (published 2017-05-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install script-chain
pnpm add script-chain
yarn add script-chain
bun add script-chain
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2017-05-10 |
| First published | 2017-04-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 13 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 30 |
| Author | James |
| Maintainers | aretecode |
| Keywords | fluent, flags, scripts, package-scripts, pkgflip, flipscript, fliphub, flipbox |

## Links

- npm: https://www.npmjs.com/package/script-chain
- Repository: https://github.com/fliphub/fliphub
- Homepage: https://github.com/fliphub/fliphub#readme
- Issues: https://github.com/fliphub/fliphub/issues
- npm.io page: https://npm.io/package/script-chain

## Dependencies (13)

- [execa](https://npm.io/package/execa.md) 0.6.3
- [to-arr](https://npm.io/package/to-arr.md) *
- [fliplog](https://npm.io/package/fliplog.md) *
- [flipfile](https://npm.io/package/flipfile.md) *
- [flipglob](https://npm.io/package/flipglob.md) *
- [fliptime](https://npm.io/package/fliptime.md) ^3.0.2
- [flipchain](https://npm.io/package/flipchain.md) *
- [likeaboss](https://npm.io/package/likeaboss.md) *
- [fliphub-core](https://npm.io/package/fliphub-core.md) *
- [funwithflags](https://npm.io/package/funwithflags.md) *
- [obj-chain-core](https://npm.io/package/obj-chain-core.md) 0.0.5
- [insert-at-index](https://npm.io/package/insert-at-index.md) *
- [obj-chain-plugin-config](https://npm.io/package/obj-chain-plugin-config.md) 0.0.5

## Recent versions

- 0.0.9 (latest) — 2017-05-10
- 0.0.8 — 2017-05-05
- 0.0.6 — 2017-04-30

## README

# 📜⛓ script-chain

[![NPM version][script-chain-npm-image]][script-chain-npm-url]
[![MIT License][license-image]][license-url]
[![fliphub][gitter-badge]][gitter-url]
[![fluents][fluents-image]][fluents-url]
[![Build Status][travis-image]][travis-url]

<!--
[![Dependencies][david-deps-img]][david-deps-url]
-->

[travis-image]: https://travis-ci.org/fluents/script-chain.svg?branch=master
[travis-url]: https://travis-ci.org/fluents/script-chain

[david-deps-img]: https://david-dm.org/fluents/script-chain.svg
[david-deps-url]: https://david-dm.org/fluents/script-chain

[fluents-image]: https://img.shields.io/badge/⛓-fluent-9659F7.svg
[fluents-url]: https://www.npmjs.com/package/flipchain

[script-chain-npm-image]: https://img.shields.io/npm/v/script-chain.svg
[script-chain-npm-url]: https://npmjs.org/package/script-chain
[license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat
[license-url]: https://spdx.org/licenses/MIT
[gitter-badge]: https://img.shields.io/gitter/room/fliphub/pink.svg
[gitter-url]: https://gitter.im/fliphub/Lobby
[flipfam-image]: https://img.shields.io/badge/%F0%9F%8F%97%20%F0%9F%92%A0-flipfam-9659F7.svg
[flipfam-url]: https://www.npmjs.com/package/flipfam

> 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](./docs)
## [🔬 tests](./tests)

## 📦 usage
```bash
yarn add script-chain
npm i script-chain --save
```

```js
const {ScriptFlip} = require('script-chain')
```

## 📘 examples

### easy

```js
const scripts = new ScriptFlip()
scripts
  .add()
  .npm('diggy')
  .env('magic')
  .flag('env.zoolala', 'aoao')
  .arg('-e')
```

### monorepo

makes tackling monorepo execution scripts a breeze

```js
const script = new ScriptFlip()
  .add()
  .env('prod')
  .lerna()
  .prefix('inferno')
  .scope('app1,app2,inferno')
  .log('info')
  .concurrency(1)
  .group(2)
  .raw('node')
  .flag('row', '0')
  .bin('tsc')

script.includes('--scope=+(inferno-app1|inferno-app2|inferno)')
```


### running

will run commands in a subprocess

```js
const scripts = new ScriptFlip()
scripts
  .add()
  .npm('diggy')
  .env('magic')
  .flag('env.zoolala', 'aoao')
  .arg('-e')

const results = await scripts.run()
```

---
_Source: https://npm.io/package/script-chain · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
