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

cordova-plugin-flic

v0.6.0

Published

A Cordova plugin providing access to the Flic SDK

Readme

Cordova-Flic

A Cordova plugin providing access to the Flic SDK

Installation

$ cordova plugin add cordova-plugin-flic

Set android:minSdkVersion="19" or higher in AndroidManifest.xml

$ cordova build android

Plugin API

It has been currently stripped to the minimum needed from a Javascript app.

The following functions are available:

  • Flic.init (appId, appSecret, appName, options). Initialize Flic and register known buttons for receiving single click, double click and hold events
    • appId: your app client ID
    • appSecret: your app client secret
    • appName: your app name
    • options: a properties object with 2 function callbacks
      • options.success: called on function success
      • options.error: called on function error
  • Flic.getKnownButtons(options). Get known buttons. Returns the list of buttons grabbed in a previous run of the app
    • options: a properties object with 2 function callbacks
      • options.success: called on function success
      • options.error: called on function error
  • Flic.grabButton(options). Grab a button and register it for receiving single click, double click and hold events. Returns the grabbed button
    • options: a properties object with 2 function callbacks
      • options.success: called on function success
      • options.error: called on function error

Sample usage code

// Init flic
Flic.init(appId, appSecret, appName, {
    success: function(result) {
        console.log('Flic init succeeded');

        // Get known buttons
        Flic.getKnownButtons({
            success: function(buttons) {
                console.log('Flic getKnownButtons succeeded');
                console.log('Flic known buttons: ' + JSON.stringify(buttons));
            },
            error: function(message) {
                console.log('Flic getKnownButtons failed: ' + message);
            }
        });

    },
    error: function(message) {
        console.log('Flic init failed: ' + message);
    }
});

// Subscription to button events
document.addEventListener('flicButtonClick', this.onFlicButtonPressed, false);
document.addEventListener('flicButtonDblClick', this.onFlicButtonPressed, false);
document.addEventListener('flicButtonHold', this.onFlicButtonPressed, false);

function onFlicButtonPressed(event) {
    console.log(event.type); //flicButtonClick
    console.log(event.buttonId); //70:d4:db:69:2f:4e
    console.log(event.color); //green
    console.log(event.status); //BUTTON_CONNECTION_COMPLETED
}

Sample app

Copy the files from the example folder to your project's platforms/android/assets/wwww folder.

Sample app screenshot

Roadmap

Next steps:

  • Implement function forgetButton(buttonId). Forget a button, which will never be associated to the app until it is grabbed again.
  • Implement function enableButton(buttonId). Subscribe button to single click, double click and hold events.
  • Implement function disableButton(buttonId). Unsubscribe button to single click, double click and hold events. Unlike when forgetting the button, the button will still be associated the app.
  • Implement function getButton(buttonId). Get a button by its device ID.
  • Implement function setActiveMode(buttonId). Set button active mode.
  • Implement function for more refined event subscription (onButtonClickOrHold, onButtonSingleOrDoubleClick, onButtonSingleOrDoubleClickOrHold, onButtonUpOrDown, onConnectionCompleted, onConnectionFailed, onConnectionStarted, onDisconnect, onReadRemoteRSSI)