{"_id":"json-lines","_rev":"326168","name":"json-lines","description":"json-lines streams JSON Lines.","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"goloroden","email":"webmaster@goloroden.de"},{"name":"nhummel","email":"hummel@marvelous.systems"},{"name":"thenativeweb-admin","email":"hello@thenativeweb.io"}],"time":{"modified":"2021-06-07T02:44:45.000Z","created":"2015-04-23T15:31:19.103Z","1.0.0":"2018-02-09T10:48:36.236Z","0.4.3":"2016-06-07T04:05:05.430Z","0.4.2":"2016-03-16T23:30:51.790Z","0.4.1":"2015-07-21T19:35:40.950Z","0.4.0":"2015-07-21T09:13:45.071Z","0.3.0":"2015-04-24T12:50:42.412Z","0.2.0":"2015-04-24T08:02:09.176Z","0.1.0":"2015-04-23T15:31:19.103Z"},"users":{},"repository":{"type":"git","url":"git://github.com/thenativeweb/json-lines.git"},"versions":{"1.0.0":{"name":"json-lines","version":"1.0.0","description":"json-lines streams JSON Lines.","contributors":[{"name":"Golo Roden","email":"golo.roden@thenativeweb.io"},{"name":"Matthias Wagler","email":"matthias.wagler@thenativeweb.io"},{"name":"Jan-Hendrik Grundhöfer","email":"jan-hendrik.grundhoefer@thenativeweb.io"}],"main":"dist/jsonLines.js","dependencies":{"timer2":"1.0.0"},"devDependencies":{"assertthat":"1.0.0","body-parser":"1.18.2","express":"4.16.2","roboter":"0.15.6","roboter-server":"0.15.6"},"repository":{"type":"git","url":"git://github.com/thenativeweb/json-lines.git"},"keywords":["json","json-lines","parser","stream"],"license":"MIT","gitHead":"fd17641bcc7009fd6139ef4504511d8a812a8f3f","bugs":{"url":"https://github.com/thenativeweb/json-lines/issues"},"homepage":"https://github.com/thenativeweb/json-lines#readme","_id":"json-lines@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"goloroden","email":"webmaster@goloroden.de"},"dist":{"shasum":"4ac6d7531deec3b928516c7f86897b548f82711d","size":5792,"noattachment":false,"key":"/json-lines/-/json-lines-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-lines/download/json-lines-1.0.0.tgz"},"maintainers":[{"name":"goloroden","email":"webmaster@goloroden.de"},{"name":"nhummel","email":"hummel@marvelous.systems"},{"name":"thenativeweb-admin","email":"hello@thenativeweb.io"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-lines_1.0.0_1518173315550_0.09302331818626541"},"_hasShrinkwrap":false,"publish_time":1518173316236,"_cnpm_publish_time":1518173316236},"0.4.3":{"name":"json-lines","version":"0.4.3","description":"json-lines streams JSON Lines.","contributors":[{"name":"Golo Roden","email":"golo.roden@thenativeweb.io"},{"name":"Matthias Wagler","email":"matthias.wagler@thenativeweb.io"}],"main":"lib/jsonLines.js","dependencies":{"timer2":"0.2.3"},"devDependencies":{"assertthat":"0.7.0","body-parser":"1.15.1","express":"4.13.4","roboter":"0.8.1"},"repository":{"type":"git","url":"git://github.com/thenativeweb/json-lines.git"},"keywords":["json","json-lines","parser","stream"],"license":"MIT","gitHead":"dd7288c48fc78576c464fe4bc45d39211cdb030b","bugs":{"url":"https://github.com/thenativeweb/json-lines/issues"},"homepage":"https://github.com/thenativeweb/json-lines#readme","_id":"json-lines@0.4.3","scripts":{},"_shasum":"31f98c83ed9b93fb0c572d8ed9fd94e5bc7fd364","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"goloroden","email":"webmaster@goloroden.de"},"dist":{"shasum":"31f98c83ed9b93fb0c572d8ed9fd94e5bc7fd364","size":4504,"noattachment":false,"key":"/json-lines/-/json-lines-0.4.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-lines/download/json-lines-0.4.3.tgz"},"maintainers":[{"name":"goloroden","email":"webmaster@goloroden.de"},{"name":"nhummel","email":"hummel@marvelous.systems"},{"name":"thenativeweb-admin","email":"hello@thenativeweb.io"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/json-lines-0.4.3.tgz_1465272303594_0.14894011802971363"},"directories":{},"publish_time":1465272305430,"_cnpm_publish_time":1465272305430,"_hasShrinkwrap":false},"0.4.2":{"name":"json-lines","version":"0.4.2","description":"json-lines streams JSON Lines.","contributors":[{"name":"Golo Roden","email":"golo.roden@thenativeweb.io"},{"name":"Matthias Wagler","email":"matthias.wagler@thenativeweb.io"}],"main":"lib/jsonLines.js","dependencies":{"timer2":"0.2.3"},"devDependencies":{"assertthat":"0.6.0","body-parser":"1.15.0","express":"4.13.4","gulp":"^3.9.1","roboter":"^0.5.1"},"repository":{"type":"git","url":"git://github.com/thenativeweb/json-lines.git"},"keywords":["json","json-lines","parser","stream"],"license":"MIT","gitHead":"a2c1d7643db4ada675cff0f55450fb1b7024b31e","bugs":{"url":"https://github.com/thenativeweb/json-lines/issues"},"homepage":"https://github.com/thenativeweb/json-lines#readme","_id":"json-lines@0.4.2","scripts":{},"_shasum":"b200c36f903bd4ec8e8f23b0c6528c5f3cbc3935","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.1","_npmUser":{"name":"goloroden","email":"webmaster@goloroden.de"},"dist":{"shasum":"b200c36f903bd4ec8e8f23b0c6528c5f3cbc3935","size":4316,"noattachment":false,"key":"/json-lines/-/json-lines-0.4.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-lines/download/json-lines-0.4.2.tgz"},"maintainers":[{"name":"goloroden","email":"webmaster@goloroden.de"},{"name":"nhummel","email":"hummel@marvelous.systems"},{"name":"thenativeweb-admin","email":"hello@thenativeweb.io"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/json-lines-0.4.2.tgz_1458171049409_0.8121169114019722"},"directories":{},"publish_time":1458171051790,"_cnpm_publish_time":1458171051790,"_hasShrinkwrap":false},"0.4.1":{"name":"json-lines","version":"0.4.1","description":"json-lines streams JSON Lines.","contributors":[{"name":"Golo Roden","email":"golo.roden@thenativeweb.io"},{"name":"Matthias Wagler","email":"matthias.wagler@thenativeweb.io"}],"main":"lib/jsonLines.js","dependencies":{"timer2":"0.2.3"},"devDependencies":{"assertthat":"0.6.0","body-parser":"1.13.2","express":"4.13.1","grunt":"0.4.5","tourism":"0.20.2"},"repository":{"type":"git","url":"git://github.com/thenativeweb/json-lines.git"},"keywords":["json","json-lines","parser","stream"],"license":"MIT","gitHead":"1dc65d2e67fc533ec2cce774ee8ffe7e5f0c1652","bugs":{"url":"https://github.com/thenativeweb/json-lines/issues"},"homepage":"https://github.com/thenativeweb/json-lines#readme","_id":"json-lines@0.4.1","scripts":{},"_shasum":"c00c583e8fdee80aa7080663b12901121b369e55","_from":".","_npmVersion":"2.11.1","_nodeVersion":"2.3.0","_npmUser":{"name":"thenativeweb","email":"hello@thenativeweb.io"},"dist":{"shasum":"c00c583e8fdee80aa7080663b12901121b369e55","size":4300,"noattachment":false,"key":"/json-lines/-/json-lines-0.4.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-lines/download/json-lines-0.4.1.tgz"},"maintainers":[{"name":"goloroden","email":"webmaster@goloroden.de"},{"name":"nhummel","email":"hummel@marvelous.systems"},{"name":"thenativeweb-admin","email":"hello@thenativeweb.io"}],"directories":{},"publish_time":1437507340950,"_cnpm_publish_time":1437507340950,"_hasShrinkwrap":false},"0.4.0":{"name":"json-lines","version":"0.4.0","description":"json-lines streams JSON Lines.","contributors":[{"name":"Golo Roden","email":"golo.roden@thenativeweb.io"},{"name":"Matthias Wagler","email":"matthias.wagler@thenativeweb.io"}],"main":"lib/jsonLines.js","dependencies":{"timer2":"0.2.3"},"devDependencies":{"assertthat":"0.6.0","body-parser":"1.13.2","express":"4.13.1","grunt":"0.4.5","tourism":"0.20.2"},"repository":{"type":"git","url":"git://github.com/thenativeweb/json-lines.git"},"keywords":["json","json-lines","parser","stream"],"license":"MIT","gitHead":"2c5b5751523b8780a7380b07bc1240d7d8278132","bugs":{"url":"https://github.com/thenativeweb/json-lines/issues"},"homepage":"https://github.com/thenativeweb/json-lines#readme","_id":"json-lines@0.4.0","scripts":{},"_shasum":"b1e38563c147a25a10e27cb4ae43cbf960f50440","_from":".","_npmVersion":"2.11.1","_nodeVersion":"2.3.0","_npmUser":{"name":"thenativeweb","email":"hello@thenativeweb.io"},"dist":{"shasum":"b1e38563c147a25a10e27cb4ae43cbf960f50440","size":4192,"noattachment":false,"key":"/json-lines/-/json-lines-0.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-lines/download/json-lines-0.4.0.tgz"},"maintainers":[{"name":"goloroden","email":"webmaster@goloroden.de"},{"name":"nhummel","email":"hummel@marvelous.systems"},{"name":"thenativeweb-admin","email":"hello@thenativeweb.io"}],"directories":{},"publish_time":1437470025071,"_cnpm_publish_time":1437470025071,"_hasShrinkwrap":false},"0.3.0":{"name":"json-lines","version":"0.3.0","description":"json-lines streams JSON Lines.","contributors":[{"name":"Golo Roden","email":"golo.roden@thenativeweb.io"},{"name":"Matthias Wagler","email":"matthias.wagler@thenativeweb.io"}],"main":"lib/jsonLines.js","dependencies":{"timer2":"0.2.2"},"devDependencies":{"assertthat":"0.6.0","express":"4.12.3","grunt":"0.4.5","tourism":"0.16.1"},"repository":{"type":"git","url":"git://github.com/thenativeweb/json-lines.git"},"keywords":["json","json-lines","parser","stream"],"license":"MIT","gitHead":"1fb546d0c86bb15962b298991ca67c00f79b0639","bugs":{"url":"https://github.com/thenativeweb/json-lines/issues"},"homepage":"https://github.com/thenativeweb/json-lines","_id":"json-lines@0.3.0","scripts":{},"_shasum":"200a8d6092b6747cdb4f893211307ea8b900e283","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"thenativeweb","email":"hello@thenativeweb.io"},"maintainers":[{"name":"goloroden","email":"webmaster@goloroden.de"},{"name":"nhummel","email":"hummel@marvelous.systems"},{"name":"thenativeweb-admin","email":"hello@thenativeweb.io"}],"dist":{"shasum":"200a8d6092b6747cdb4f893211307ea8b900e283","size":3517,"noattachment":false,"key":"/json-lines/-/json-lines-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-lines/download/json-lines-0.3.0.tgz"},"directories":{},"publish_time":1429879842412,"_cnpm_publish_time":1429879842412,"_hasShrinkwrap":false},"0.2.0":{"name":"json-lines","version":"0.2.0","description":"json-lines streams JSON Lines.","contributors":[{"name":"Golo Roden","email":"golo.roden@thenativeweb.io"},{"name":"Matthias Wagler","email":"matthias.wagler@thenativeweb.io"}],"main":"lib/jsonLines.js","dependencies":{"timer2":"0.2.2"},"devDependencies":{"assertthat":"0.6.0","express":"4.12.3","grunt":"0.4.5","tourism":"0.16.1"},"repository":{"type":"git","url":"git://github.com/thenativeweb/json-lines.git"},"keywords":["json","json-lines","parser","stream"],"license":"MIT","gitHead":"1493f1ea2367f7916d5373386200271250b1f7b1","bugs":{"url":"https://github.com/thenativeweb/json-lines/issues"},"homepage":"https://github.com/thenativeweb/json-lines","_id":"json-lines@0.2.0","scripts":{},"_shasum":"588e818b83f53106e30520d38445818efc957848","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"thenativeweb","email":"hello@thenativeweb.io"},"maintainers":[{"name":"goloroden","email":"webmaster@goloroden.de"},{"name":"nhummel","email":"hummel@marvelous.systems"},{"name":"thenativeweb-admin","email":"hello@thenativeweb.io"}],"dist":{"shasum":"588e818b83f53106e30520d38445818efc957848","size":3505,"noattachment":false,"key":"/json-lines/-/json-lines-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-lines/download/json-lines-0.2.0.tgz"},"directories":{},"publish_time":1429862529176,"_cnpm_publish_time":1429862529176,"_hasShrinkwrap":false},"0.1.0":{"name":"json-lines","version":"0.1.0","description":"json-lines streams JSON Lines.","contributors":[{"name":"Golo Roden","email":"golo.roden@thenativeweb.io"},{"name":"Matthias Wagler","email":"matthias.wagler@thenativeweb.io"}],"main":"lib/jsonLines.js","dependencies":{"timer2":"0.2.2"},"devDependencies":{"assertthat":"0.6.0","express":"4.12.3","grunt":"0.4.5","tourism":"0.16.1"},"repository":{"type":"git","url":"git://github.com/thenativeweb/json-lines.git"},"keywords":["json","json-lines","parser","stream"],"license":"MIT","gitHead":"d47e4a48f0aa993e4363d6560ff2496fb3094612","bugs":{"url":"https://github.com/thenativeweb/json-lines/issues"},"homepage":"https://github.com/thenativeweb/json-lines","_id":"json-lines@0.1.0","scripts":{},"_shasum":"5777bd7a5130e5206fce0d80e80a2229ca568689","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"thenativeweb","email":"hello@thenativeweb.io"},"maintainers":[{"name":"goloroden","email":"webmaster@goloroden.de"},{"name":"nhummel","email":"hummel@marvelous.systems"},{"name":"thenativeweb-admin","email":"hello@thenativeweb.io"}],"dist":{"shasum":"5777bd7a5130e5206fce0d80e80a2229ca568689","size":3358,"noattachment":false,"key":"/json-lines/-/json-lines-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/json-lines/download/json-lines-0.1.0.tgz"},"directories":{},"publish_time":1429803079103,"_cnpm_publish_time":1429803079103,"_hasShrinkwrap":false}},"readme":"# json-lines\n\njson-lines streams JSON Lines.\n\n## Installation\n\n```shell\n$ npm install json-lines\n```\n\n## Quick start\n\nFirst you need to add a reference to json-lines in your application.\n\n```javascript\nconst jsonLines = require('json-lines');\n```\n\nTo send JSON you need an Express application and a route that you want to use. Please note that for technical reasons json-lines only works with `POST` routes.\n\nThen subscribe to the `connect` and `disconnect` events to initialize or end data transfer.\n\n```javascript\napp.post('/events', jsonLines(client => {\n  client.once('connect', () => {\n    // ...\n  });\n\n  client.once('disconnect', () => {\n    // ...\n  });\n}));\n```\n\nWithin the `connect` event handler, you can use the `send` function to actually stream data to the client.\n\n```javascript\nclient.send({\n  foo: 'bar'\n});\n```\n\nIf you want to close the connection to the client, call the `disconnect` function. This will emit the `disconnect` event and clean up any event listeners.\n\n```javascript\nclient.disconnect();\n```\n\n### Parsing the request body\n\nFrom time to time you may want to send a request body to the json-lines route, e.g. to provide a configuration object. On the server, you can access the request's body using the `req.body` property of the `client` object.\n\nIn order to do so you *must* add the [body-parser middleware](https://www.npmjs.com/package/body-parser) to your application, before adding the route itself.\n\n```javascript\nconst bodyParser = require('body-parser');\n\napp.use(bodyParser.json());\n\napp.post('/events', jsonLines(client => {\n  console.log(client.req.body);\n  // => {\n  //      foo: 'bar'\n  //    }\n}));\n```\n\n### Using the client module\n\nTo connect to a json-lines enabled server, use the [json-lines-client](https://www.npmjs.com/package/json-lines-client) module.\n\n## Running the build\n\nTo build this module use [roboter](https://www.npmjs.com/package/roboter).\n\n```shell\n$ bot\n```\n\n## License\n\nThe MIT License (MIT)\nCopyright (c) 2015-2018 the native web.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_attachments":{},"homepage":"https://github.com/thenativeweb/json-lines#readme","bugs":{"url":"https://github.com/thenativeweb/json-lines/issues"},"license":"MIT"}