Higher-level builder for Normalize

Usage no npm install needed!

<script type="module">
  import normalizeBuild from '';


Normalize Build

NPM version

Dependency Status License Downloads Gittip

High level builder for normalize using with normalize-builder and file-watch. The JS API is as close to nlz-build(1)'s API as possible.

  • Automatically includes the require() implementation
  • Automatically executes the entry point - require(boot)
  • Automatically watch for file changes and reuilbd


var Build = require('normalize-build')

var builder = Build(options)

builder = Build(options)

Pretty much all the same as the other libraries.

  • directory: 'repositories' - directory to install all the remote dependencies
  • agent - a normalize-agent instance

builder.add(entrypoint, options)

Add an entry point. Must be an absolute URI.

JavaScript options:

  • require: true - include the require() implementation
  • autorequire: true - automatically execute the entry point

Run as a watcher. The process remains open, and the entry points will automatically rebuild on file changes.

var text = yield*

Build a specific entry point. Returns the result as a string.

var results[] = yield*

Without an entrypoint, .build() will build all the entry points in the order defined. If you forget, check .entrypoints.

Event: tree

Every time the tree is resolved.

build.on('tree', function (tree, ms) {
  console.log('built tree in: ' + ms + 'ms')

Event: <entrypoint>

Every time an entry point is built, an event by its name will be built.

build.on('/User/jong/index.js', function (js) {
  fs.writeFile('/User/jong/build/index.js', js)


If you don't use .watch(), you should just use, then options.agent.close() to close the connection to the server. Otherwise, the process will never exit.