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

adf-plugin-barcode

v1.0.3

Published

You can use the BarcodeScanner plugin to scan different types of barcodes (using the device's camera) and get the metadata encoded in them for processing within your application.

Readme

ADF Barcode Plugin

バーコードを読み取るAPIを提供します。

導入方法

cordova plugin add adf-plugin-barcode

対応OS

  • Android
  • iOS
  • Windows

使用例

index.html

<!DOCTYPE html>
<html>
<body>
  <button id='scan' style='width: 105px; height: 74px'>Scan</button>
  <br><br>
  <div id='output'><p>History:</p></div>
  <script type='text/javascript' src='cordova.js'></script>
  <script type='text/javascript' src='barcode.js'></script>
</body>
</html>

barcode.js

var output = document.getElementById('output');
document.getElementById('scan').addEventListener('mousedown', scanBarcode);
function scanBarcode() {
  cordova.plugins.barcodeScanner.scan(
    // successCallback
    function(result) {
      if (result.cancelled) { return; }

      var element = document.createElement('p');
      element.innerHTML = result.text + ', ' + result.format;
      output.appendChild(element);
    },
    // errorCallback
    function(error) { console.log('Failed: ' + error); },
    // config JANコードのみ読み取ります。
    {
      'SCAN_MODE': 'ONE_D_MODE',
      'SCAN_FILTER': '^4[59]([0-9]{6}|[0-9]{11})$',
      'SCAN_FORMATS': 'EAN_8,EAN_13'
    }
  );
}

スキャン設定一覧

|設定|値(カッコ内は規定値)|Description| |-|-|-| |SCAN_MODE|TWO_D_MODE | ONE_D_MODE (TWO_D_MODE)|スキャンモードを指定します。TWO_D_MODE: 長方形のカメラ枠にします。一次元コードと二次元コードを読み取ります。ONE_D_MODE: 横長のカメラ枠にします。一次元コードだけ読み取ります。| |SCAN_FILTER|正規表現文字列(なし)例:IMEIをスキャンする場合:'^[0-9]{15}$'JANコードをスキャンする場合:'^4[59]([0-9]{6}|[0-9]{11})$'|正規表現にマッチしたバーコードだけを読み取るように制限します。省略時は制限しません。※判定はネイティブ側で行います。各言語(Java, Objective-C, C#)の違いによって正規表現が異なる場合があります。その場合はCordovaのマージ機能を利用します。| |SCAN_FORMATSまたはformats|対応フォーマット一覧に記載の文字列(なし)|読み取るフォーマットを限定します。省略時はすべてのフォーマットを読み取ります。(Androidの場合、PDF417とAZTECは明示的に指定が必要です。)カンマ区切りで複数指定できます。| |RESULT_DISPLAY_DURATION_MS|0-5000(1500)|バーコードを読み取った後に一時停止する時間。5000以上を指定した場合は5000ms(5秒間)停止します。| |PROMPT_MESSAGEまたはprompt|任意の文字列(空文字)|スキャン画面に表示されるメッセージを指定します。| |ORIENTATION_LOCKまたはorientation|landscape | portrait(なし)|カメラ枠の向きを指定します。省略時は画面の向きに合わせて回転します。| |CAMERA_DELAY|0-10000(1000)|(Windowsのみ有効)カメラの開始を指定時間待ちます。10000以上のときは10000ms(10秒間)待ちます。端末によって、スキャン画面をキャンセルした直後にスキャンを開始するとエラーが発生します。この設定で端末に合わせてスキャンの開始を調整でき、エラーを回避できます。|

対応フォーマット一覧

|フォーマット|Android|iOS|Windows| |-|-|-|-| |QR_CODE|○|○|○| |DATA_MATRIX|○|○|○| |UPC_E|○|○|○| |UPC_A|○|○|○| |EAN_8|○|○|○| |EAN_13|○|○|○| |CODE_39|○|○|○| |CODE_93|○|-|○| |CODE_128|○|○|○| |CODABAR|○|○|○| |ITF|○|○|○| |RSS_14|○|-|○| |PDF_417|○*|-|○| |RSS_EXPANDED|○|-|-| |MSI|-|-|○| |AZTEC|○*|-|○|