# broccoli-file-creator

> Broccoli plugin to create a file.

Latest version **2.1.1** (published 2018-04-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install broccoli-file-creator
pnpm add broccoli-file-creator
yarn add broccoli-file-creator
bun add broccoli-file-creator
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2018-04-17 |
| First published | 2014-04-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^4.5 \|\| 6.* \|\| >= 7.* |
| Dependencies | 2 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Robert Jackson |
| Maintainers | rwjblue, stefanpenner |
| Keywords | broccoli-plugin, javascript |

## Links

- npm: https://www.npmjs.com/package/broccoli-file-creator
- Repository: https://github.com/rjackson/broccoli-file-creator
- Homepage: https://github.com/rjackson/broccoli-file-creator#readme
- Issues: https://github.com/rjackson/broccoli-file-creator/issues
- npm.io page: https://npm.io/package/broccoli-file-creator

## Dependencies (2)

- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [broccoli-plugin](https://npm.io/package/broccoli-plugin.md) ^1.1.0

## Recent versions

- 2.1.1 (latest) — 2018-04-17
- 2.1.0 — 2018-04-17
- 2.0.0 — 2018-04-17
- 1.2.0 — 2018-04-17
- 1.1.1 — 2016-08-05
- 1.1.0 — 2015-12-30
- 1.0.1 — 2015-11-17
- 1.0.0 — 2015-08-20
- 0.1.0 — 2014-04-22

## README

# Broccoli's File Creator

[![Build Status](https://travis-ci.org/rwjblue/broccoli-file-creator.svg?branch=master)](https://travis-ci.org/rjackson/broccoli-file-creator)

## Usage

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

```javascript
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.

```js
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:

```javascript
npm install
npm test
```

## License

This project is distributed under the MIT license.

---
_Source: https://npm.io/package/broccoli-file-creator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
