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

@hecto/form

v3.0.0

Published

`@hecto/form/view` is an optional adapter. `useForm(options)` creates an owned service; `useFormService(service)` borrows one and releases only its field subscriptions and registrations. Call both inside a View owner. A borrowed idle service is activated

Readme

Native View fields

@hecto/form/view is an optional adapter. useForm(options) creates an owned service; useFormService(service) borrows one and releases only its field subscriptions and registrations. Call both inside a View owner. A borrowed idle service is activated by its caller. Server rendering reads initial state without starting services, registering fields, subscribing or scheduling timers.

import { useForm } from '@hecto/form/view'
const form = useForm({
  defaultValues: { name: '', age: 0, tags: [] as string[] },
  onSubmit(values) { save(values) },
})
const name = form.field('name', { key: 'profile.name', parse: value => String(value) })
// Native input: spread name.inputProps(), bind value to name.value.
// The form element receives form.formProps().
form.field('age').setValue(42)
form.array('tags').append('native')

Fields support typed top-level names and readonly path tuples such as ['people', 0, 'name']. Value, array item, validation and submit callback types come from the supplied initial/default values. Native validators are keyed by top-level fields; the neutral service retains explicit path-based validation. Schema validators currently report issues; they do not transform submitted values, so this adapter does not claim a separate inferred schema-output value.

Give input-bound fields an explicit stable key and inverse parse function during setup, before constructing their DOM controls. The adapter adopts captured early browser input into the same service and emits data-hg-field. value() and field metadata track only that field's selection. inputProps() requires this explicit adapter; read-only fields need no input options. Control inversion is explicit: the default kind: 'text' reads a string; kind: 'checked' emits checked and parses a boolean; kind: 'multiple' emits multiple and an array-valued value; kind: 'radio' requires optionValue and updates the shared field only for its checked option. Supply a unique hydration key per radio option. format, when supplied, returns the matching string, boolean or string-array DOM value. Bind live value/checked properties to field accessors when constructing controls imperatively; HGX reactive spreads can call field.inputProps(). Types alone never choose a control mode.

Separate bindings to one field share a reference-counted registration. Disposal cancels pending activation and allows remount. connectForm now caches its live fields and exposes field.dispose() and form.dispose() for non-View ownership; inactive fields wait on the service lifecycle without retry timers, and termination releases their waiters.