Permalink
Browse files

[doc] README and LICENSE

  • Loading branch information...
1 parent fa365e2 commit 5f0b9b9c3474a4cbb2f3b002a6879d0040a5dd24 @mmalecki committed Jun 11, 2012
Showing with 48 additions and 0 deletions.
  1. +19 −0 LICENSE
  2. +29 −0 README.md
View
19 LICENSE
@@ -0,0 +1,19 @@
+Copyright (C) 2011 by Maciej Małecki
+
+Permission 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:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE 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.
View
@@ -0,0 +1,29 @@
+# json-stream [![Build Status](https://secure.travis-ci.org/mmalecki/json-stream.png)](http://travis-ci.org/mmalecki/json-stream)
+New line-delimeted JSON parser with a stream interface.
+
+## Installation
+
+ npm install json-stream
+
+## Usage
+```js
+var JSONStream = require('json-stream');
+
+var stream = new JSONStream();
+
+stream.on('data', function (chunk) {
+ console.dir(chunk);
+});
+stream.write('{"a":');
+stream.write('42}\n');
+stream.write('{"hel');
+stream.write('lo": "world"}\n');
+```
+
+Will output:
+```
+{ a: 42 }
+{ hello: 'world' }
+```
+
+If invalid JSON gets written, it's silently ignored.

0 comments on commit 5f0b9b9

Please sign in to comment.