dom-cursor-stream

DOMCursor objects as readable streams.

Usage no npm install needed!

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

README

dom-cursor-stream

dom-cursor-stream is a module that wraps up DOMCursor objects in readable streams.

Build status

install

$ npm install dom-cursor-stream

usage

var readable = require('dom-cursor-stream')
var through = require('through2')
var cursor = navigator.mozContacts.getAll()

readable(cursor)
  .on('error', console.error.bind(console))
  .pipe(through.obj(function (contact, enc, next) {
    console.log('contact:', contact.name.join('\n'))
    next()
  }))