···8899## Usage
10101111-A `LexiconCatalog` holds your lexicon documents and resolves cross-references between them. You can handwrite or copy/paste lexicons inline or [fetch them by NSID](#fetching-lexicons) — either way, add them to the catalog, then call `schema(nsid)` to get a Standard Schema validator:
1111+A `TinyLex` instance holds your lexicon documents and resolves cross-references between them. You can handwrite or copy/paste lexicons inline or [fetch them by NSID](#fetching-lexicons) — either way, add them to the catalog, then call `schema(nsid)` to get a Standard Schema validator:
12121313```js
1414-import { LexiconCatalog } from "./tinylex.js";
1414+import TinyLex from "./tinylex.js";
15151616-const lexicons = new LexiconCatalog().add({
1616+const lexicons = new TinyLex().add({
1717 lexicon: 1,
1818 id: "com.example.follow",
1919 defs: {
···5353./tinylex-install app.bsky.feed.post --js
5454```
55555656-Output defaults to `./lexicons/<nsid>.json`. Pass `--js` to emit `.js` files wrapped in `export default /** @type {const} */ ({...})` so imports keep literal types (otherwise TypeScript widens the JSON and `LexiconCatalog.add()` can't infer narrow types for `result.value`).
5656+Output defaults to `./lexicons/<nsid>.json`. Pass `--js` to emit `.js` files wrapped in `export default /** @type {const} */ ({...})` so imports keep literal types (otherwise TypeScript widens the JSON and `TinyLex.add()` can't infer narrow types for `result.value`).
57575858The script is a polyglot shell/JS file that picks the first available runtime among Node, Deno and Bun.
5959