uuid-stream

A Transform stream that generates RFC-compliant UUID v5.

Usage no npm install needed!

<script type="module">
  import uuidStream from 'https://cdn.skypack.dev/uuid-stream';
</script>

README

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.