FrontierJS

Toolbelt

Substrate@frontierjs/toolbelt

The facts that have many possible answers and must have exactly one.

$ npm i @frontierjs/toolbelt

Zero dependencies

Substrate below the graph, not a member of it

That is what buys the import licence: because it depends on nothing, every package may import it without inverting the dependency direction the framework is built on.

Replaces

a shared utils package nobody may depend on

One kit per import

No root entry — you import the kit you need

A grab-bag with one entry point is a package every consumer pulls whole. A subpath per kit means a browser bundle carries the two you used.

import { plural } from '@frontierjs/toolbelt/inflect'
import { canAtLevel } from '@frontierjs/toolbelt/gate'

Replaces

lodasha utils folder copied between projects

Spelling

/inflect — singular, plural, table, model, human

Three separate resolvers have to agree on what a model is called. One kit is how they do, rather than three regexes that agree until an irregular noun arrives.

Replaces

pluralizea naming helper per package

Meaning

/query and /directives — what a query string says

A string is a number only if it round-trips as one; true, false and null are themselves; structure is bracket notation. Three readers agree because there is one table.

Replaces

qsa parser per boundary

Time and money

/datetime · /units

An instant read in a zone and written back, with the runtime’s own zone rules; rounding, allocation and currency data that ship rather than being read off the host.

Replaces

date-fns + a timezone librarydinero.jsIntl called directly

Rules

/gate · /predicate · /match · /signature · /redact · /cron

The access ladder and its grader, the schema expression language, whether a record still belongs in a query, a signed machine-to-machine request, whether a key is a credential, and what five fields mean.

Replaces

a copy of each, per package

Kits

inflectgatedirectivesqueryhistorymatchsignatureredactcronpredicatehooksjsonschemajsonunitsglowsearchdatetime