Permalink
Browse files

use sink as module

  • Loading branch information...
1 parent 8401bd2 commit fdefff61d508a4e261af174eb69136818b8cef94 @Floby committed Mar 29, 2013
Showing with 7 additions and 27 deletions.
  1. +2 −1 package.json
  2. +0 −21 test/sink.js
  3. +1 −1 test/test-00-onefile.js
  4. +1 −1 test/test-10-include.js
  5. +1 −1 test/test-20-data.js
  6. +1 −1 test/test-25-data-stream.js
  7. +1 −1 test/test-30-filter.js
View
@@ -10,7 +10,8 @@
"stream-stream": "~1.1.0"
},
"devDependencies": {
- "nodeunit":"0.7"
+ "nodeunit":"0.7",
+ "stream-sink":"1.x.x"
},
"scripts": {
"test": "nodeunit test/test-*.js"
View
@@ -1,21 +0,0 @@
-var util = require('util');
-var stream = require('stream');
-
-function Sink () {
- if(!(this instanceof Sink)) return new Sink()
- stream.Writable.call(this);
- this._result = [];
- this.on('finish', function() {
- this.emit('data', this._result.join(''));
- });
-}
-util.inherits(Sink, stream.Writable);
-
-Sink.prototype._write = function _write(chunk, encoding, callback) {
- this._result.push(chunk.toString('utf8'));
- return callback();
-};
-
-module.exports = Sink;
-
-
@@ -1,4 +1,4 @@
-var Sink = require('./sink');
+var Sink = require('stream-sink');
var blue = require('../');
exports.testOneFile = function(test) {
@@ -1,4 +1,4 @@
-var Sink = require('./sink');
+var Sink = require('stream-sink');
var blue = require('../');
exports.testSimpleInclude = function(test) {
@@ -1,4 +1,4 @@
-var Sink = require('./sink');
+var Sink = require('stream-sink');
var blue = require('../');
exports.testDataString = function(test) {
@@ -1,4 +1,4 @@
-var Sink = require('./sink');
+var Sink = require('stream-sink');
var blue = require('../');
exports.testDataStream = function(test) {
@@ -1,4 +1,4 @@
-var Sink = require('./sink');
+var Sink = require('stream-sink');
var blue = require('../');
exports.testFilterData = function(test) {

0 comments on commit fdefff6

Please sign in to comment.