1 # write [![NPM version](https://badge.fury.io/js/write.svg)](http://badge.fury.io/js/write) [![Build Status](https://travis-ci.org/jonschlinkert/write.svg)](https://travis-ci.org/jonschlinkert/write)
3 > Write files to disk, creating intermediate directories if they don't exist.
5 Install with [npm](https://www.npmjs.com/)
13 ### [writeFile](index.js#L32)
15 Asynchronously write a file to disk. Creates any intermediate directories if they don't already exist.
19 * `dest` **{String}**: Destination file path
20 * `str` **{String}**: String to write to disk.
21 * `callback` **{Function}**
26 var writeFile = require('write');
27 writeFile('foo.txt', 'This is content to write.', function(err) {
28 if (err) console.log(err);
32 ### [.writeFile.sync](index.js#L64)
34 Synchronously write files to disk. Creates any intermediate directories if they don't already exist.
38 * `dest` **{String}**: Destination file path
39 * `str` **{String}**: String to write to disk.
44 var writeFile = require('write');
45 writeFile.sync('foo.txt', 'This is content to write.');
48 ### [.writeFile.stream](index.js#L87)
50 Uses `fs.createWriteStream`, but also creates any intermediate directories if they don't already exist.
54 * `dest` **{String}**: Destination file path
55 * `returns` **{Stream}**: Returns a write stream.
60 var write = require('write');
61 write.stream('foo.txt');
66 * [delete](https://github.com/jonschlinkert/delete): Delete files and folders and any intermediate directories if they exist (sync and async).
67 * [read-yaml](https://github.com/jonschlinkert/read-yaml): Very thin wrapper around js-yaml for directly reading in YAML files.
68 * [read-json](https://github.com/azer/read-json): Reads and parses a JSON file.
69 * [read-data](https://github.com/jonschlinkert/read-data): Read JSON or YAML files.
70 * [write-yaml](https://github.com/jonschlinkert/write-yaml): Write YAML. Converts JSON to YAML writes it to the specified file.
71 * [write-json](https://github.com/jonschlinkert/write-json): Write a JSON to file disk, also creates directories in the dest path if they… [more](https://github.com/jonschlinkert/write-json)
75 Install dev dependencies:
78 $ npm i -d && npm test
83 Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/write/issues/new)
89 + [github/jonschlinkert](https://github.com/jonschlinkert)
90 + [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
94 Copyright © 2015 Jon Schlinkert
95 Released under the MIT license.
99 _This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 29, 2015._