mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
15 lines
408 B
TypeScript
15 lines
408 B
TypeScript
/// <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());
|
|
|