Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

evrythng-scan

evrythng4Apache-2.03.0.0-pre

Plugin for evrythng.js that adds Barcode, QR code, Image Recognition and OCR scanning to applications.

evrythng, evt, iot, wot, internet of things, web of things, scanthng, thngscan, thng-scan

readme

evrythng-scan.js

js-standard-style

Getting started

Install evrythng-scan.js using npm.

npm install evrythng-scan

Then require it into any module.

const EVT = require('evrythng')
const EVTScan = require('evrythng-scan')

EVT.use(EVTScan)

/* ... Init app using EVT.js ... */

app.scan().then(match => {
  app.redirect(match.redirections[0].redirectUrl)
})

Browser

To use immutable from a browser, download dist/evrythng-scan.min.js or use a CDN such as CDNJS or jsDelivr.

Then, add it as a script tag to your page:

<script src="evrythng.min.js"></script>
<script src="evrythng-scan.min.js"></script>
<script>
    EVT.use(EVTScan)

    /* ... Init app using EVT.js ... */

    app.scan().then(match => {
      app.redirect(match.redirections[0].redirectUrl)
    })
</script>

Or use an AMD loader (such as RequireJS):

require(['./evrythng.min.js', './evrythng-scan.min.js'], (EVT, EVTScan) => {
    EVT.use(EVTScan)

    /* ... Init app using EVT.js ... */

    app.scan().then(match => {
      app.redirect(match.redirections[0].redirectUrl)
    })
})

If you're using browserify, the evrythng-scan npm module also works from the browser.