UNPKG

auto-parse

Version:

Automatically convert any value to its best matching JavaScript type. Supports numbers, booleans, objects, arrays, BigInt, Symbol, comma-separated numbers, prefix stripping, allowed type enforcement and a plugin API.

14 lines (11 loc) 652 B
# Example Usage These small scripts demonstrate common ways to use **auto-parse**. Run any of them with `node <file>` from this directory. - `basic.js` showcases parsing of primitive values and objects. - `plugin.js` illustrates registering a simple plugin. - `types.js` covers advanced types like `BigInt` and `Symbol`. - `dates.js` demonstrates the optional date/time parsing capability. - `urls.js` shows URL and file path detection. - `error-handler.js` shows how to supply a custom `onError` callback. - `global-error-handler.js` demonstrates setting a fallback for all parses. - `all-options.js` exercises every available option in one script.