{"name":"writejson","version":"2.0.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":{"lint":"redrun lint:*","lint:lib":"eslint lib","lint:test":"eslint -c .eslintrc.test --no-eslintrc test","test":"tape test/*.js","coverage":"nyc npm test","report":"nyc report --reporter=text-lcov | coveralls"},"repository":{"type":"git","url":"git+ssh://git@github.com/coderaiser/node-writejson.git"},"keywords":["read","parse","json"],"dependencies":{"try-catch":"^2.0.0"},"devDependencies":{"coveralls":"^3.0.0","es6-promisify":"^6.0.0","eslint":"^4.19.1","eslint-plugin-node":"^6.0.1","nyc":"^12.0.2","redrun":"^6.0.0","tape":"^4.2.2","try-to-catch":"^1.0.2"},"engines":{"node":">=4.0.0"},"gitHead":"8fc647f9653b1d632fc7ff74d104ffc36d480289","homepage":"https://github.com/coderaiser/node-writejson#readme","_id":"writejson@2.0.1","_npmVersion":"6.1.0","_nodeVersion":"10.4.1","_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"dist":{"integrity":"sha512-L8sjHabAAph4TXKsS1Q7CPUBpuheIACbUIG6QHVdPgTPLNKmP/2bc+rGdQvu14NZrEj8YOuIyPJuqonf3qyCCg==","shasum":"a977e57ead480a9a7641410e27d1afa58ebaf90b","tarball":"http://registry-npm.ywwl.com/writejson/download/writejson-2.0.1.tgz","fileCount":5,"unpackedSize":7563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbIm5eCRA9TVsSAnZWagAAd8EP/jd84eP4ZxKHyL1xpVyT\nB0RsBbTOXdqfwQvorMvbAKmC1tW+ssx3WDRuHqMv4zdkBjg+Z0YRt+oSJOh7\nUQQiyXVLDEWnsOEf+++laxCVd7s+FtoPwEMGiMVt0nt59FW+QvoBO5mHKATL\nBB4bdKiViSLRW+VO1aqFa/25weQcHo1bux1Grs08ek9Ps8EbFFFsQarW40Y5\nlFTwRad49xb4fl4nkK+IoCzEyYlMvUq9MjNvHIH+DnnF43QkcQRUqimaW3zx\nXNGLH2eTK1lNuMWRAVBFZj64D7/HVWpJwHxEEGC3kSNMYloYc2pmc4/fJhOb\nqevdeJ2org+Gikx9eHEGzGcE/bbT4raeJRD1wou1ilcqfdVNBDAgkeWOnX3z\nQfSU2ERCIfJ31ml4JgLOpeok7bshJwB0hL+BDiVc0B4KHSZR7qRpyvecIBqX\nXdSl9rPhvGf/KuMJeiMpoXXnBJsTBMFNPQCA9+GKIX/hyMex9fR1I26XXnWR\ndaoolzHMNM0pqJhML5J4c92HuCGNZjZjqRl2n2f9NMkkDic79AXmtkGWd4q8\nK9o7ssQ4GQBeJMj6b1w0RsoiwLgnLu57nS+hwQm942Ee64p2ZvQPU1mFLY7D\nKUkFtrZR2nssdNny9DrX899sWvzPdQ4sEWrKeCh3D4j1Wx20wp6jpRLEm6o2\n7myL\r\n=Dsmp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDu65wftLhij4FpR99RqDZQJtHTlTbTmizFlyGCW38EjQIhALutc8z9FhoFkgO31Lc2D245en/1h6+zTGDi7sTE22xq"}],"size":2946,"noattachment":false,"key":"/writejson/-/writejson-2.0.1.tgz"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/writejson_2.0.1_1528983134384_0.7891304449757746"},"_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":1528983134494,"_cnpm_publish_time":1528983134494,"dist-tags":{"latest":"3.0.0"}}