Tarragon Builder is a is a script/library that does literally nothing. The rest of this readme is made up.
npm install tarragon-builder
The library exports a single function. This function takes the following arguments:
operation- an object that contains the following:
filterthat matches files to be transformed
targetthat describes where to save the transformed file
pipelinethat describes the sequence of transformation steps
previousHashes- a mapping of filename to md5 hash, allowing the function to avoid processing unchanged files
The filter should be an array of strings to be passed into a
The target is an EJS templated string with the following variables:
dir- the dirname of the source file
base- the basename of the source file
ext- the extension of the source file (
The pipeline is simply an array of functions that return promises. The functions each take the path of the file to transform. In general each function is expected to read from the file, perform some arbitrary transformation and then write back to the same file. Note that at this point the file has already been moved to its target destination.
In order for tarragon-builder to work, it expects to be run in the target project directory root. It expects the presence of a
build.js file. This file exports the config that tarragon builder reads. An example config looks like this:
This library can also be run as a daemon if installed globally. In order to use this daemon, it expects to find a
build.js file in the project root, that exports an array of
operation objects. Simply run:
tarragon-build to kick the daemon off.
It should first do an entire rebuild as it discovers all the files for the first time, followed by then only transforming files if and when they change.