{"name":"writejson","version":"1.0.0","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":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/coderaiser/node-writejson.git"},"keywords":["read","parse","json"],"dependencies":{"try-catch":"~1.0.0"},"devDependencies":{"tape":"^4.2.2"},"gitHead":"9aa76a1de24651cbf4aca1d7f2fffabd92df76c8","homepage":"https://github.com/coderaiser/node-writejson#readme","_id":"writejson@1.0.0","_shasum":"d5b6bb0f9ce6d7fce17ac8273b9bced5b9d517da","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.2.0","_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"dist":{"shasum":"d5b6bb0f9ce6d7fce17ac8273b9bced5b9d517da","tarball":"http://registry-npm.ywwl.com/writejson/download/writejson-1.0.0.tgz","integrity":"sha512-n0g+Yn+M9zcH81jrk2qyl25ppdsAGoPgnxz1FRkoITNCG8DlDEvVVNhpp98HbihXVpzFQibWy92erZhKXi/tnw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFUf7AVKabnATZ2bw2KnL0RE9W4BGYt3gOTPWMQprGTDAiEAuochVHBbjv0Krl4EDYwq8C9wr+gwGzzf1JIlHqik4ag="}],"size":2329,"noattachment":false,"key":"/writejson/-/writejson-1.0.0.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":1450201804559,"_cnpm_publish_time":1450201804559,"dist-tags":{"latest":"3.0.0"}}