diff --git a/split/split-tests.ts b/split/split-tests.ts new file mode 100644 index 0000000000..71af1a0857 --- /dev/null +++ b/split/split-tests.ts @@ -0,0 +1,16 @@ +/// +/// + +import stream = require("stream"); +import split = require("split"); + +var testStream = new stream.Readable(); + +testStream.pipe = function(dest) { + dest.write("This is \r\n new \r\n line"); + return dest; +}; + +testStream.pipe(split(/(\r?\n)/, null, {maxLength: 20})).on("data", function(line) { + console.log("Line: " + line + "\r\n"); +}); diff --git a/split/split.d.ts b/split/split.d.ts new file mode 100644 index 0000000000..9bf6a93204 --- /dev/null +++ b/split/split.d.ts @@ -0,0 +1,17 @@ +// Type definitions for split v0.3.3 +// Project: https://github.com/dominictarr/split +// Definitions by: Marcin Porębski +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "split" { + + interface SplitOptions { + maxLength: number + } + + function split(matcher?:any, mapper?:any, options?: SplitOptions):any; + + export = split; +} \ No newline at end of file