broccoli-file-creator
Broccoli plugin to create a file.
Last updated 2 years ago by stefanpenner .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install broccoli-file-creator 
SYNC missed versions from official npm registry.

Broccoli's File Creator

Build Status

Usage

Create a file named app/main.js with "some content goes here":

let writeFile = require('broccoli-file-creator');
let tree = writeFile('/app/main.js', 'some content goes here');

Documentation

writeFile(filename, content, fileOptions)


filename {String}

The path of the file to create.


content {String|Function|Promise}

The contents to write into the file.

writeFile('filename.txt', 'the-content');
writeFile('filename.txt', Promise.resolve('the-content'));
writeFile('filename.txt', () => 'the-content');
writeFile('filename.txt', () => Promise.resolve('the-content'));

note: If a function is provided, it will only be invoked once, on first build

ZOMG!!! TESTS?!?!!?

I know, right?

Running the tests:

npm install
npm test

License

This project is distributed under the MIT license.

Current Tags

  • 2.1.1                                ...           latest (2 years ago)

9 Versions

  • 2.1.1                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 0.1.0                                ...           6 years ago
Downloads
Today 11
This Week 18
This Month 138
Last Day 7
Last Week 45
Last Month 368
Dependencies (2)
Dev Dependencies (4)
Dependents (119)

Copyright 2014 - 2016 © taobao.org |