## Usage Add to your node.js application with the following line of code: ```js var writeData = require('{%= name %}'); // async writeData(filepath, data[, options], function(err) { // do stuff with "err" }); // sync writeData.sync(filepath, data[, options]); ``` ## API The file extension is used to detect the data format to write. This can be overriden by passing a value on `options.ext`. ### YAML examples ```js var data = {language: 'node_js', node_js: ['0.10', '0.12']}; // async writeData('.travis.yml', data, function(err) { // do stuff with "err" }); // sync writeData.sync('.travis.yml', data); ``` Both would write a `.travis.yml` file to disk with the following contents: ```yaml language: node_js node_js: - "0.10" - "0.12" ``` ### JSON examples ```js var data = { name: 'foo', version: '0.1.0' }; // async writeData('package.json', data, function(err) { // do stuff with "err" }); // sync writeData.sync('package.json', data); ``` Both would write a `package.json` file to disk with the following contents: ```json { "name": "foo", "version": "0.1.0" } ```