broccoli-diffing-writer

0.0.1 • Public • Published

Broccoli Diffing Writer

A flavor of broccoli-writer which diffs its input between rebuilds. When the build method is called, it is called with an array of entry objects that represent any changes that took place.

Example

var Plugin = require('broccoli-diffing-writer');
 
MyPlugin.prototype = Object.create(Plugin.prototype);
MyPlugin.prototype.constructor = MyPlugin;
function MyPlugin(inputNode, options) {
  options = options || {};
 
  Plugin.call(this, inputNode, {
    annotation: options.annotation
  });
}
 
MyPlugin.prototype.build = function(diff) {
  // diff is an array containing changes
  // [
  //   ['create', 'some/file.js', { ... }],
  //   ['unlink', 'deleted/file/here.js', { ... }],
  //   ['change', 'some/changed/file.js', { ... }]
  // ]
};

Documentation

new DiffingWriter(inputNode, options)

Call this base class constructor from your subclass constructor.

  • inputNode: A single input node.

  • options:

Tests

Running the tests:

npm install
npm test

License

This project is distributed under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i broccoli-diffing-writer

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • zackthehuman