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

neural-formmap

v0.1.2

Published

A tiny local model that maps messy form fields to standard autocomplete names.

Readme

neural-formmap

A tiny local model that maps messy form labels and attributes to standard HTML autocomplete field names.

import { mapField } from "neural-formmap";

mapField({
  label: "Where should we send updates?",
  name: "contactEmail",
  placeholder: "[email protected]",
});
// { type: "email", autocomplete: "email", source: "model", ... }

CLI

Pass a plain label:

npx neural-formmap "Work email"

Or pass a JSON field descriptor:

npx neural-formmap '{"label":"Apt / Suite","name":"unit"}'

Piped input is read as JSON Lines. A JSON array maps a complete form.

How it works

The mapper follows a strict evidence order:

  1. A valid autocomplete attribute wins.
  2. Unambiguous HTML types such as email, tel, url, and search win.
  3. A dependency-free 128 → 24 → 22 neural network classifies hashed features from the label, name, id, placeholder, input type, and nearby context.

The model has 3,646 parameters and runs locally. There is no server, telemetry, inference framework, or runtime dependency.

API

  • mapField(field | label) maps one field and returns the best type, confidence, evidence source, and three alternatives.
  • mapForm(fields) maps a list while preserving its order.
  • FIELD_KINDS exposes the supported vocabulary.

The vocabulary covers names, credentials, contact information, addresses, payment fields, search, and unknown. It follows HTML autocomplete names where an equivalent exists.

Scope

This package classifies field purpose. It does not read the DOM, fill values, store personal data, or bypass form validation. Integrations should gather accessible labels and attributes, then decide whether a confidence threshold is sufficient for their use case.

The checked-in model is trained and evaluated on deterministic synthetic variations. The proof is reproducible, but it does not establish accuracy on arbitrary production forms, languages, or adversarial markup. See MODEL_CARD.md.

Development

Requires Bun 1.3 or newer.

bun run train
bun run check
bun run benchmark

CI retrains the model and verifies that src/weights.ts is byte-for-byte reproducible. See docs/prior-art.md for the project boundary.

License

MIT