DefinitelyTyped/bufferstream/bufferstream-tests.ts
2017-02-23 07:15:16 -08:00

15 lines
370 B
TypeScript

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());