Nachos Preventing Motivation
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

broccoli-object-writer

1.0.2 • Public • Published

Broccoli Object Writer

Broccoli Object Writer is a tool for writing out JS Objects as either JSON, or as an AMD and CommonJS compatible UMD module.

Version npmSupport via GratipayNPM DownloadsBuild StatusDependencies

Install Broccoli Object Writer

NPM

$ npm install broccoli-object-writer --save

Documentation

writeConfig(outputFile, data)

outputFile {String}

The file path to write your configuration to.

Supported extensions are .json and .js, which output JSON files or UMD modules, respectfully

data {Object OR Function}

Either a Javascript Object that will be stringified using JSON.stringify, or a function that returns a Javascript Object.

Example

var writeObject = require('broccoli-object-writer'),
  mergeTrees = require('broccoli-merge-trees'),
  fixtures = require('./lib/fixtures'),
  funnel = require('broccoli-funnel');

var coreAssets = 'assets';

var vendorAssets = 'vendor';

var assets = mergeTrees([
  writeObject('fixtures.js', fixtures),
  vendorAssets,
  coreAssets
], {
  overwrite: true
});

module.exports = assets;

Install

npm i broccoli-object-writer

DownloadsWeekly Downloads

8

Version

1.0.2

License

ISC

Last publish

Collaborators

  • avatar