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

rfid-keyboard

v0.1.1

Published

Open-source RFID / keyboard-wedge engine + custom DSL for kiosk/access flows (browser & Electron)

Readme

rfid-keyboard

rfid-keyboard adalah module npm open-source untuk menangkap input dari RFID reader / barcode scanner yang berperilaku seperti keyboard (keyboard-wedge), plus DSL (bahasa custom) untuk bikin flow login / access / kiosk tanpa harus nulis JS panjang.

  • ✅ Browser / HTML biasa (renderer)
  • ✅ Electron (via BrowserWindow.webContents.executeJavaScript)
  • ✅ DSL v0.1 (START/END, let, bar.input create.new, sync, if/else, redirect, sound)

Catatan keamanan: ini bukan "security system" yang kuat. Jangan taruh secret penting di frontend.


Install

npm i rfid-keyboard

Quick Start (Browser / Renderer)

index.html

<!doctype html>
<html>
  <head><meta charset="utf-8" /></head>
  <body>
    <h1>RFID demo</h1>
    <script type="module">
      import { runDSL } from "rfid-keyboard/browser";

      const dsl = `
START
let password = "001001"

bar.input create.new hiddenBar {
  transparent == true
  autofocus == true
}

sync hiddenBar {
  if == password {
    user.redirect "success.html"
  } else {
    sound.play "failed.mp3"
    user.redirect "index.html"
  }
}
END
      `.trim();

      runDSL(dsl, { debug: true });
    </script>
  </body>
</html>

Quick Start (Electron Main)

import { BrowserWindow, app } from "electron";
import fs from "node:fs";
import { injectDSL } from "rfid-keyboard/electron";

app.whenReady().then(async () => {
  const win = new BrowserWindow({
    width: 900,
    height: 600,
    webPreferences: { contextIsolation: true }
  });

  await win.loadFile("index.html");

  const dsl = fs.readFileSync("flow.rfid", "utf8");
  await injectDSL(win, dsl, { debug: true });
});

DSL Spec (v0.1)

Program markers

  • START dan END optional (kalau tidak ada pun tetap diparse).

Variables

let password = "001001"
let dashboard = "index.html"

Create hidden input bar

bar.input create.new hiddenBar {
  transparent == true
  autofocus == true
}

Properties v0.1:

  • transparent: true|false|1|0
  • autofocus: true|false|1|0
  • maxInterval: number (ms), default 50
  • requiredLen: number, default = panjang target compare (mis. password)

Sync + If/Else

sync hiddenBar {
  if == password {
    user.redirect "success.html"
  } else {
    sound.play "failed.mp3"
  }
}

Supported conditions v0.1:

  • if match { ... } -> compare input dengan variable password (kalau ada)
  • if == password { ... } -> compare input dengan variable password
  • if == "001001" { ... } -> compare input dengan string literal

Supported commands v0.1:

  • user.redirect "file.html"
  • sound.play "file.mp3"
  • Alias yang juga diterima:
    • user.direct == index.html
    • user.direct to index.html
    • play.sound:failed.mp3

API

Browser

import { runDSL } from "rfid-keyboard/browser";
runDSL(dslText, { debug: true });

Electron

import { injectDSL } from "rfid-keyboard/electron";
await injectDSL(win, dslText, { debug: true });

Publish ke npm

  1. Update version:
npm version patch
  1. Login:
npm login
  1. Publish:
npm publish --access public

License

MIT