{"name":"writejson","version":"1.1.1","description":"Write stringified object to file","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"http://coderaiser.github.io/"},"license":"MIT","bugs":{"url":"https://github.com/coderaiser/node-writejson/issues"},"main":"lib/writejson.js","scripts":{"jscs":"jscs --esnext lib test","jshint":"jshint lib test","codestyle":"npm-run-all jshint jscs","test":"tape test/*.js","coverage":"nyc npm test"},"repository":{"type":"git","url":"git+ssh://git@github.com/coderaiser/node-writejson.git"},"keywords":["read","parse","json"],"dependencies":{"try-catch":"~1.0.0"},"devDependencies":{"jscs":"^2.7.0","jshint":"^2.8.0","npm-run-all":"^1.4.0","nyc":"~5.0.1","tape":"^4.2.2"},"gitHead":"246ae14ebd9652e018ecbebe4c2442fee9a12b52","homepage":"https://github.com/coderaiser/node-writejson#readme","_id":"writejson@1.1.1","_shasum":"2a7241e50a8106c3b6c10aaeb56d5ae0a60930aa","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"dist":{"shasum":"2a7241e50a8106c3b6c10aaeb56d5ae0a60930aa","tarball":"http://registry-npm.ywwl.com/writejson/download/writejson-1.1.1.tgz","integrity":"sha512-Mhq+FMiZMlMX07wsjXiQgB6Cyn5cbgPWaxSiYKPrgcUlJCOw31nUC/hdMxT3r4PfzxUh2D7qSiEzDzQMZ0dCxw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBMfjINrX7XVmOhMjsOUPbY2/XrfXPgJH6OiBFVpp+FMAiAtc1a972YidjA64OQ31T+ghjY5IKh5PYcIhYqa65XILg=="}],"size":3798,"noattachment":false,"key":"/writejson/-/writejson-1.1.1.tgz"},"directories":{},"readme":"# writejson [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]\n\nWrite stringified object to file.\n\n## Install\n\n```\nnpm i writejson --save\n```\n## How to use?\nTo handle formating optional argument `options` could be used according to [JSON.stringify][StringifyURL].\n\n### API\n\n#### writejson(name, object[, options], callback)\nAsynchonouse write stringified object.\n\n```js\nconst writejson = require('writejson');\n\nconst [error] = await tryToCatch(writejson, 'data.json', {hello: 'world'});\n\nif (error)\n    console.error(error.message);\n\nconst options = {\n    replacer: ['hello'],    // properties to put in json\n    space: 4,               // default space count\n    eof: true,              // default new line at end of file\n    encoding: 'utf8',       // default\n    mode: '0o666',          // default\n    flag: 'w',              // default\n};\n\nawait writejson('data.json', {hello: 'world'}, options);\n\n```\n#### writejson.sync(name, object[, options])\nSynchonouse write stringified object.\n\n```js\ntry {\n    writejson.sync('data.json', {hello: 'world'});\n} catch(error) {\n    console.log(error.message);\n}\n```\n\n#### writejson.sync.try(name, object[, options])\nSynchonouse try to write stringified object.\n\n```js\nwritejson.sync.try('data.json', {hello: 'world'});\n```\n\n## License\n\nMIT\n\n[StringifyURL]:             https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify\n[NPMIMGURL]:                https://img.shields.io/npm/v/writejson.svg?style=flat\n[BuildStatusIMGURL]:        https://img.shields.io/travis/coderaiser/node-writejson/master.svg?style=flat\n[DependencyStatusIMGURL]:   https://img.shields.io/david/coderaiser/node-writejson.svg?style=flat\n[LicenseIMGURL]:            https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat\n[CoverageIMGURL]:           https://coveralls.io/repos/coderaiser/node-writejson/badge.svg?branch=master&service=github\n[NPMURL]:                   https://npmjs.org/package/writejson \"npm\"\n[BuildStatusURL]:           https://travis-ci.org/coderaiser/node-writejson  \"Build Status\"\n[DependencyStatusURL]:      https://david-dm.org/coderaiser/node-writejson \"Dependency Status\"\n[LicenseURL]:               https://tldrlegal.com/license/mit-license \"MIT License\"\n[CoverageURL]:              https://coveralls.io/github/coderaiser/node-writejson?branch=master\n","publish_time":1450466762193,"_cnpm_publish_time":1450466762193,"dist-tags":{"latest":"3.0.0"}}