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 🙏

© 2026 – Pkg Stats / Ryan Hefner

scnnr

v1.0.3

Published

Official #CBK scnnr client library for JavaScript

Readme

Official #CBK scnnr client library for JavaScript.

Installation

NPM

npm install --save scnnr

Yarn

yarn add scnnr

Configuration

You can pass configuration options as an object on creating a client instance.

import scnnr from 'scnnr'
const client = scnnr({
  apiKey: 'YOUR API KEY',
  version: 'v1',
  timeout: 0, // sec
})

Or, you can use a public API key as follows.

import scnnr from 'scnnr'
const client = scnnr({
  publicAPIKey: 'YOUR PUBLIC API KEY',
})

For more details about public API keys, please see here.

Operations through the client basically return Promise instance and the promises will be resolved with a Recognition instance.

Examples

Basic usage

Request image recognition by an image URL.

const url = 'https://example.com/dummy.jpg'
let promisedRecognition = client.recognizeURL(url)

// Or, you can override timeout option.
promisedRecognition = client.recognizeURL(url, { timeout: 10 })

Request image recognition by a binary image.

promisedRecognition = client.recognizeImage(image) // image is an ArrayBuffer

Recognition class represents the image recognition result from API. If the recognition processing is completed, the promise is resolved with Recognition with finished state.

promisedRecognition
  .filter(recognition => console.log(recognition.state === 'finished')) // => true

promisedRecognition
  .filter(recognition => console.log(JSON.stringify(recognition, null, 2)))
/*
=> {
  "id": "20171207/27c6e071-c8f0-426e-806b-4a8b4390aef7",
  "objects": [
    {
      "category": "bottoms",
      "boundingBox": {
        "bottom": 1,
        "left": 0.3233167,
        "right": 0.7062677,
        "top": 0.46807754
      },
      "labels": [
        {
          "name": "パンツ",
          "score": 0.9952112
        },
        {
          "name": "スキニー",
          "score": 0.9802289
        },
        {
          "name": "ブラック",
          "score": 0.81389445
        },
        {
          "name": "デニム",
          "score": 0.8030528
        },
        {
          "name": "ジーンズ",
          "score": 0.7185342
        }
      ]
    },
    {
      "category": "tops_1",
      "boundingBox": {
        "bottom": 0.5370441,
        "left": 0.2191737,
        "right": 0.7182835,
        "top": 0.06979297
      },
      "labels": [
        {
          "name": "カーキ",
          "score": 0.98178136
        },
        {
          "name": "Tシャツ",
          "score": 0.95349556
        },
        {
          "name": "無地",
          "score": 0.90042996
        },
        {
          "name": "Vネック",
          "score": 0.8733328
        },
        {
          "name": "カットソー",
          "score": 0.7097928
        },
        {
          "name": "プルオーバー",
          "score": 0.51508075
        }
      ]
    }
  ],
  "state": "finished"
}
 */

If the timeout value is zero or null, the promise is resolved with Recognition with queued state.

Then you can fetch the recognition result using client.fetch.

promisedRecognition.then(recognition => console.log(recognition.state === 'queued')) // => true

promisedRecognition.then(recognition => console.log(JSON.stringify(recognition)))
// => {"id":"20171207/27c6e071-c8f0-426e-806b-4a8b4390aef7","state":"queued"}

promisedRecognition.then(recognition => client.fetch(recognition.id))
  .then(recognition => console.log(recognition.state === 'finished')) // => true