chunked-stream
Advanced tools
Comparing version 0.0.1 to 0.0.2
0.0.2 / 2013-07-22 | ||
================== | ||
* Changed test framework from Mocha to Lab. | ||
* Added example. | ||
0.0.1 / 2012-05-04 | ||
@@ -3,0 +9,0 @@ ================== |
{ | ||
"name": "chunked-stream", | ||
"description": "Chunked Stream on a pattern. \\n by default.", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"keywords": [ | ||
"stream" | ||
], | ||
"author": "Daniel D. Shaw <dshaw@dshaw.com> (http://dshaw.com)", | ||
"author": { | ||
"name": "Daniel D. Shaw", | ||
"email": "dshaw@dshaw.com", | ||
"url": "http://dshaw.com" | ||
}, | ||
"repository": { | ||
@@ -18,9 +22,8 @@ "type": "git", | ||
"scripts": { | ||
"test": "make test" | ||
"test": "lab ./test/*.test.js" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"mocha": "~1.0.3" | ||
"lab": "~0.1.6" | ||
}, | ||
"optionalDependencies": {}, | ||
"engines": { | ||
@@ -27,0 +30,0 @@ "node": "*" |
@@ -5,4 +5,45 @@ # Chunked Stream | ||
## TODO | ||
## Status | ||
Write out a meaningful Readme. | ||
![Travis Build Status](https://secure.travis-ci.org/dshaw/chunked-stream.png) | ||
## Install | ||
npm install chunked-stream | ||
## Usage - Cluster More! | ||
var ChunkedStream = require('..') | ||
, chunkedStream = ChunkedStream() | ||
chunkedStream.on('data', function (data) { | ||
process.stdout.write(data) | ||
}) | ||
chunkedStream.write('cool story\nbro') | ||
chunkedStream.end() | ||
## License | ||
(The MIT License) | ||
Copyright (c) 2012-2013 Daniel D. Shaw, http://dshaw.com | ||
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. |
var assert = require('assert') | ||
, mocha = require('mocha') | ||
, lab = require('lab') | ||
, Stream = require('stream').Stream | ||
, ChunkedStream = require('..') | ||
// setup BDD | ||
var describe = lab.experiment | ||
, it = lab.test | ||
, expect = lab.expect | ||
, before = lab.before | ||
, after = lab.after | ||
//console.dir(ChunkedStream) | ||
describe('ChunkedStream', function () { | ||
var chunkedStream = ChunkedStream() | ||
describe('ChunkedStream', function () { | ||
var chunkedStream = ChunkedStream() | ||
it('should be a ChunkedStream', function (done) { | ||
assert.ok(chunkedStream instanceof ChunkedStream) | ||
done() | ||
}) | ||
it('should be a ChunkedStream', function (done) { | ||
assert.ok(chunkedStream instanceof ChunkedStream) | ||
it('should be a Stream', function (done) { | ||
assert.ok(chunkedStream instanceof Stream) | ||
done() | ||
}) | ||
it('should accumulate the value written to it', function (done) { | ||
chunkedStream.on('data', function (data) { | ||
assert.deepEqual(data, 'cool story\n') | ||
done() | ||
}) | ||
it('should be a Stream', function (done) { | ||
assert.ok(chunkedStream instanceof Stream) | ||
chunkedStream.write('cool story\nbro') | ||
}) | ||
// configure a chunkedStream to chunk on tabs | ||
var tabChunkedStream = ChunkedStream('\t') | ||
it('should chunk on configured matcher', function (done) { | ||
tabChunkedStream.on('data', function (data) { | ||
assert.deepEqual(data, 'one fish\t') | ||
done() | ||
}) | ||
it('should accumulate the value written to it', function (done) { | ||
chunkedStream.on('data', function (data) { | ||
assert.deepEqual(data, 'cool story\n') | ||
done() | ||
}) | ||
chunkedStream.write('cool story\nbro') | ||
}) | ||
tabChunkedStream.write('one fish\ttwo fish\tred fish\tblue fish\t\n') | ||
}) | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5289
9
101
49