{"name":"writejson","version":"3.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":{"fix:lint":"madrun fix:lint","lint":"madrun lint","test":"madrun test","coverage":"madrun coverage","report":"madrun report"},"repository":{"type":"git","url":"git+ssh://git@github.com/coderaiser/node-writejson.git"},"keywords":["read","parse","json"],"dependencies":{"try-catch":"^3.0.0"},"devDependencies":{"coveralls":"^3.0.0","es6-promisify":"^6.0.0","eslint":"^6.8.0","eslint-plugin-node":"^11.0.0","eslint-plugin-putout":"^3.2.1","madrun":"^5.4.4","nyc":"^15.0.0","putout":"^7.13.4","redrun":"^7.0.0","supertape":"^1.2.4","tape":"^4.2.2","try-to-catch":"^3.0.0"},"engines":{"node":">=10.0.0"},"gitHead":"d0cde2eab68c0555e5562f1fc91c2aa847594d74","homepage":"https://github.com/coderaiser/node-writejson#readme","_id":"writejson@3.0.0","_nodeVersion":"13.9.0","_npmVersion":"6.12.1","dist":{"integrity":"sha512-ekMZxrB4zBl0RHBlObSVcU+2Nx7Xe9vZLcgJFe2oHLfgkjl5LueAgilGrgXVKJRs/y/xP3FteyvUP3QurJ058A==","shasum":"20e9397de514699d7c2ecdc26a3ebac06d8c74a7","tarball":"http://registry-npm.ywwl.com/writejson/download/writejson-3.0.0.tgz","fileCount":5,"unpackedSize":7504,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeV/I5CRA9TVsSAnZWagAA4KYP/jDeWF8y1K/lrmNq7+B8\nJefQu3gZOiNzU1oZPnNtlL0U0C1rRfWf8XbCnurwWXmYqQXtw3BGEBS/qZ38\nxtfg7dIqjHOfKZTOaP3NvjpvYJ0urbapfUVVy1qIxuppkbOquZcMu0gow0P3\nTwGbud7GkdRvwW8Gks2umVHXgDkBoaXE6MOfbNDvpRjFEQ22j03SX2jH5C7Y\nk5PMBCVg6hpdgDAIrbN7o+Ho8lP4VeseMk7fPmEJYJgGFc/qT+GW5HyOhnLG\nQHOhQVq5z5JazAA6B6d66gkhDK7XnA2TGT+9p50hiaxMl/sAz0/0B2E3/dE2\nHrNB4FIdB4S82TTwUjIfIy/c7VIh5tKA7ygSSthmKB/eAV4+IjpAx9BD3nAz\nBKruktVX0xnoi1CNw96pUe5EnbuvgZS8p1iRZ3705wM3DASoIwAOMhMAMCql\n76I3i5x48WUZx11cPntIdUVAuccq9LvgBz6pqI11yUEmzVheOHvM0XBFByHU\nQJrqj+TU6RSkO/M+xYCFMjvTj0BuxRZiwy4BJxIZoWDD/nKA0qdOvLtXJaQw\nPSTFA/WRTSfBhaO3HSgosC2MmuyYdkQvgEzB0nF+RzjjMWiNjPXZRrdB6Yba\ndk3xlSzmq773N/rXHhtSNcEfz/b0S5VWlU5jKMRsh8EH/xTy0APhbpjZgFVd\naQNQ\r\n=x89E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCg/dfUoJW18wh93onh74Tiqb+5e1s/6CoeoMIOQLi57wIhALVKkI4Sz0C9QXLQ97VtqT1wTNOnw9tWuCK18egbRK9y"}],"size":2957,"noattachment":false,"key":"/writejson/-/writejson-3.0.0.tgz"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/writejson_3.0.0_1582821944955_0.5669314902718992"},"_hasShrinkwrap":false,"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":1582821945130,"_cnpm_publish_time":1582821945130,"dist-tags":{"latest":"3.0.0"}}