{"name":"writejson","version":"2.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":{"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":"d4caed3085f64d2f0f6a36fceb384ade5a9c9293","homepage":"https://github.com/coderaiser/node-writejson#readme","_id":"writejson@2.0.0","_npmVersion":"6.1.0","_nodeVersion":"10.4.1","_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"dist":{"integrity":"sha512-KdZslqbRw3+nDpoqi3VFurryUjBZOHRMq8XrbequAKwdCHLtoeWAVx5TC1z0NzLFO9VNamFERvU0bvdPjNBgKQ==","shasum":"d86ac5ae95564565a2193b3bf9334337f28d1a17","tarball":"http://registry-npm.ywwl.com/writejson/download/writejson-2.0.0.tgz","fileCount":8,"unpackedSize":15999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbImj/CRA9TVsSAnZWagAAZTgQAI1la7SmTYN17BVFZsL3\nxVn7YVT3t4Ja1stwf9OzpyX0LUnPqiar7eQ9Dxwgf1jNs+zkn7f7YmqXV/tJ\ncL+uQrbf5xHftMpL0+yB3xelfk0aIzs6Oc90JejXYuHfrgFIqgb8fGCsdO5w\nr7D5N5elDS8AVL6k9oE5/fCHi7Awsf0w7RcNp9ztecql6pZJDeGKjNIO0XcG\nqXAzB8DV/EgesbizA8sW+9g8yebEQX693/wzN1hjzSYxfh12hySiFCkdefP6\nyBKqbaQGt5M9Oe+5iCcHau+j5gjHWtl9YudqqoFu3mi/mcm1pIRWRpUD5AR0\nKOYVGfdR3lMPDA19Ob7NRj1jdwJsDXL4D+gEeXNrdfkDIrv99yq0pvp3Ybjk\nVRJ9DzWJc/in/8RRz+XxYbyRXIMQ7myt7dBTBUFNpXIBf0Z3ZRlBVZ7UJsmF\nW+NWBVMOJOrY80Pz6eIVEBU7pCx3eLIArV+GlhiYEhwLHcOolUmMBiQI4eFU\nGFzya0megyfcsjt42xz4jeIhcPTFa+oiQtOKOUcslOoyfBFWDE7FY9Ei96Ud\ng2wf3SaOXYoO1MMNSgdHgJXTVSn6Wuyc0rwvFK4Gdr7Ed3l/QUGOH7pqoUBk\nJNsF9mQab7rXuu7qlrxNoPgyIBgmudBldH9zhILIaps4OKv428gLZM1faOEi\n7+hu\r\n=539Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPvXTpEVrxbO2hEHatF2HBrzZ//4eBnXYa1MZzXTbipwIgSC9ycC16y1BTIaoW9VBeB8B7ybyoYNwv5l8geMgcvw0="}],"size":4628,"noattachment":false,"key":"/writejson/-/writejson-2.0.0.tgz"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/writejson_2.0.0_1528981758531_0.49044209499700364"},"_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":1528981758604,"_cnpm_publish_time":1528981758604,"dist-tags":{"latest":"3.0.0"}}