added definitions for bufferstream

This commit is contained in:
Bart van der Schoor
2014-06-19 17:37:58 +02:00
parent 6745ac3279
commit 3c1c84fb4c
2 changed files with 133 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
/// <reference path="bufferstream.d.ts" />
import BufferStream = require('bufferstream')
var stream = new BufferStream({encoding:'utf8', size:'flexible'});
stream.enable();
stream.disable();
stream.split('//', ':');
stream.on('split', (chunk: any, token: any) => {
console.log("got '%s' by '%s'", chunk.toString(), token.toString())
});
stream.write("buffer:stream//23");
console.log(stream.toString());