1.1.6 • Published 4 years ago
uuid-stream v1.1.6
UUID Stream
A Transform stream that generates RFC-compliant UUID v5.
Installation
npm install uuid-stream
Usage
const UuidStream = require('uuid-stream');
const stream = new UuidStream();
const readstream = getReadStreamSomehow();
let result = null;
stream
.on('error', e => {
reject(e);
})
.on('uuid', data => {
result = data.toString();
})
.on('data', data => {
// data passes through if you need to do more!
})
.on('finish', () => {
resolve(result);
});
readstream.pipe(stream);
Just like node-uuid for uuid v5, but removed the need to have all contents in-memory to be compatible with streams.