Packages
@form2js/core
Turn path-like key/value pairs into nested objects and flatten them back into entries.
@form2js/dom
Parse browser form controls into an object while preserving native submission behavior.
@form2js/form-data
Parse FormData and tuple entries with the same path rules used by the core parser.
@form2js/react
Handle React form submission with parsed payloads, optional schema validation, and submit state.
@form2js/js2form
Push nested object data back into matching DOM form controls.
@form2js/jquery
Install a jQuery plugin wrapper around the DOM parser for legacy form handling flows.
Who this is for
- Developers choosing between the
@form2js/*packages - Teams migrating from the legacy
form2jsflow to package-specific APIs - Anyone who needs exact options, exported types, and behavior notes
Package Guide
@form2js/core: parse path-like entries into nested objects and flatten them back out@form2js/dom: turn browser form controls into an object@form2js/form-data: parseFormDataor tuple entries with the same path rules@form2js/react: handle React form submission with parsing, validation, and submit state@form2js/js2form: push nested object data back into form controls@form2js/jquery: install a jQuery plugin on top of the DOM parser
These rules apply across parser-based packages such as core, dom, and form-data.
- Dot paths build nested objects:
person.name.firstbecomes{ person: { name: { first: ... } } } - Repeated
[]pushes into arrays in encounter order:roles[] - Indexed arrays are compacted in first-seen order:
items[8],items[5]becomes indexes0,1 - Rails-style brackets are supported:
rails[field][value] - By default, empty string and
nullare skipped (skipEmpty: true) - Unsafe key path segments (
__proto__,prototype,constructor) are rejected by default