Merge pull request #3747 from marcinporebski/master

split v0.3.3
This commit is contained in:
Masahiro Wakame
2015-03-03 00:11:38 +09:00
2 changed files with 33 additions and 0 deletions

16
split/split-tests.ts Normal file
View File

@@ -0,0 +1,16 @@
/// <reference path="split.d.ts" />
/// <reference path="../node/node.d.ts" />
import stream = require("stream");
import split = require("split");
var testStream = new stream.Readable();
testStream.pipe = function(dest: stream.Writable) {
dest.write("This is \r\n new \r\n line");
return dest;
};
testStream.pipe(split(/(\r?\n)/, null, {maxLength: 20})).on("data", function(line: Buffer) {
console.log("Line: " + line.toString('ascii') + "\r\n");
});

17
split/split.d.ts vendored Normal file
View File

@@ -0,0 +1,17 @@
// Type definitions for split v0.3.3
// Project: https://github.com/dominictarr/split
// Definitions by: Marcin Porębski <https://github.com/marcinporebski>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "split" {
interface SplitOptions {
maxLength: number
}
function split(matcher?:any, mapper?:any, options?: SplitOptions):any;
export = split;
}