uuid-stream

1.1.6 • Public • Published

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.

Package Sidebar

Install

npm i uuid-stream

Weekly Downloads

3

Version

1.1.6

License

SEE LICENSE IN LICENSE

Unpacked Size

6.96 kB

Total Files

5

Last publish

Collaborators

  • pyramation