npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

com-darryncampbell-enterprisebarcode

v0.0.4

Published

Proof of Concept Cordova Wrapper for Symbol Mobile Devices which use EMDK

Downloads

4

Readme

This plugin is provided without guarantee or warranty

npm version npm downloads npm downloads npm licence

EnterpriseBarcode

This plugin defines an enterpriseBarcode object which provides an API for interacting with the hardware scanner on Zebra devices. The enterpriseBarcode object is not available until after the deviceready event.

document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
    console.log(enterpriseBarcode);
}

Installation

cordova plugin add https://github.com/darryncampbell/EnterpriseBarcodePoC.git

Requires Cordova 5.0 or higher otherwise your application will get build errors. When updating from a previous Cordova version it is necessary to re-add this plugin

Supported Platforms

  • Android

enterpriseBarcode.enumerate

Returns the available hardware scanners on the device

enterpriseBarcode.enumerate(enumerateSuccess, enumerateFailure);

Description

The enterpriseBarcode.enumerate function queries the device hardware for available scanners and returns them through the success callback

Android Quirks

Barcode functionality is only available for Zebra mobile devices.

Example

Output the available scanners to the console

enterpriseBarcode.enumerate(
    function(scannersObj)
    {
        for(scanner in scannersObj.scanners)
        {
            console.log("Scanner: " + scanner.friendlyName);
        }
    },
    function(status)
    {
        console.log("Failed to Enumerate Scanners: " + status.message);
    }
);

The Scanners are also available through the enterpriseBarcode.scanners property after the device ready event.

for(scanner in enterpriseBarcode.scanners)
{
    console.log("Scanner: " + scanner.friendlyName);
}

Barcode Options

Optional parameters to customize the Scanner settings can be provided either through the setProperties method or through the enable method. These settings will persist until the application is closed.

{   code11Enabled : true,
    code128Enabled : true,
    code39Enabled : false,
    code93Enabled : false,
    dataMatrixEnabled : false,
    ean8Enabled : true,
    ean13Enabled : true,
    upcaEnabled : true,
    upce1Enabled : false,
    pdf417Enabled : true,
    friendlyName : '2D Barcode Imager'};
    

Options

  • code11Enabled : Enable or Disable recognition of the Code 11 Symbology
  • code128Enabled : Enable or Disable recognition of the Code 128 Symbology
  • code39Enabled : Enable or Disable recognition of the Code 39 Symbology
  • code93Enabled : Enable or Disable recognition of the Code 93 Symbology
  • dataMatrixEnabled : Enable or Disable recognition of the Data Matrix Symbology
  • ean8Enabled : Enable or Disable recognition of the EAN 8 Symbology
  • ean13Enabled : Enable or Disable recognition of the EAN 13 Symbology
  • upcaEnabled : Enable or Disable recognition of the UPCA Symbology
  • upce1Enabled : Enable or Disable recognition of the UPCE1 Symbology
  • pdf417Enabled : Enable or Disable recognition of the PDF417 Symbology
  • friendlyName : Specifies which scanner should be enabled. Only applicable to options passed to the enable method.

Quirks

Not all barcode scanners will support all symbologies, for instance 2D symbologies like PDF417 will not be supported on 1D laser scanners.

enterpriseBarcode.enable

Enables the barcode scanner hardware and the associated trigger, so pressing the hardware trigger will initiate a scan.

enterpriseBarcode.enable(enableSuccess, enableFailure, barcodeOptions);

Description

The Enable method will instruct the scanning hardware to initialise and attach the trigger that can subsequently be used to initiate a scan. The success callback is called firstly to indicate that the scanner has successfully enabled and subsequently on each barcode scan (see example)

Example

enterpriseBarcode.enable(
    function(scannedObj)
    {
        if (scannedObj.status == "enabled")
            console.log("Scanner has successfully enabled");
        else
        {
            console.log("Scan Data: " + scannedObj.data);
            console.log("Scan Symbology: "  + scannedObj.type);
            console.log("Scan Time: " + scannedObj.timestamp);
        }
    },
    function(status)
    {
        console.log("Enable Failure: " + status.message);
    },
    {
        'friendlyName':'2D Barcode Imager'
    }
);

enterpriseBarcode.disable

Disables the currently enabled barcode scanner hardware and disconnects the associated trigger.

enterpriseBarcode.disable(disableSuccess, disableFailure);

Description

The Disable method will instruct the currently enabled scanning hardware to deinitialise. Calling disable without having previously enabled a scanner will have no effect.

Example

enterpriseBarcode.disable(
    function(status)
    {
        console.log("Disable Success: " + status.message);
    },
    function(status)
    {
        console.log("Disable Failure: " + status.message);
    }
);

enterpriseBarcode.setProperties

Sets any of the properties listed under barcodeOptions to the currently enabled scanner. If there is no currently enabled scanner then this method has no effect.

Example

enterpriseBarcode.setProperties(
    function(status)
    {
        console.log("Set Properties Success: " + status.message);
    },
    function(status)
    {
        console.log("Set Properties Failure: " + status.message);
    },
    {
        'code11Enabled':true,
        'code39Enabled':false
    }
);

enterpriseBarcode.getProperties

Retrieves the properties listed under barcodeOptions from the currently enabled scanner. If there is no currently enabled scanner then this method has no effect.

Example

enterpriseBarcode.getProperties(
    function(props)
    {
        document.getElementById("code11Check").checked = props.code11Enabled;
        document.getElementById("code39Check").checked = props.code39Enabled;
    },
    function(data)
    {
        console.log("Get Properties Failure: " + status.message);
    }
);