tranz
The framework for transform anything
Feature
- Allow running shell script as processor
- Allow concurrent multi-processor for fast speed
- Support runtime configuration
Where use it?
-
Transform git commit message for your self own processor.
Use it with husky (Git hooks made easy)
Then the end of commit message would be appended with current branch name.
Installation
npm install tranz# or use yarn yarn add tranz
Usage
Package
tranz(input: any, processors: Array<Function | [string, any] | string>, options?): Promise<any>
index.js
// Output:// $_10-abc-01_$-abc
lib/wrapper.js
module { // this.cwd === __dirname // this.parallel === false // this.userc === true // `this` is equals to options shallowly return `` }
lib/multi-wrapper.js
module `` Promise
CLI
npm i tranz -D
npx tranz -h
tranz -i $PWD -p ./upper
cat $PWD | tranz -p ./upper
RC Config
package.json
Bulit-in Processor
See source code
- _json-parse - run
JSON.parse(input, reviver?)
- _json-stringify - run
JSON.stringify(input, replacer?, space?)
Example
Processor Inheritance
Write the processor as follow:
// This processor depends `./upper` and `./trimLeft` processormodule {} require {}
Multi-tranz config in rc config
-
package.json
-
Run command in shell
tranz --input="" # echo defaulttranz --input="" --name="foo" # echo foo
Tests
Unit
npm test
Benchmark
npm run benchmark
Roadmap
- file write [tranz-globs]
- file glob [tranz-globs]
- ignore files [tranz-globs]
Related
Authors
This library is written and maintained by imcuttle, moyuyc95@gmail.com.
License
MIT