# @atproto/lex-json

> Lexicon encoding utilities for AT Lexicon data in JSON format

Latest version **0.1.6** (published 2026-08-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @atproto/lex-json
pnpm add @atproto/lex-json
yarn add @atproto/lex-json
bun add @atproto/lex-json
```

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2026-08-03 |
| First published | 2025-11-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=22 |
| Dependencies | 2 |
| Unpacked size | 141.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 9622 |
| Maintainers | dholms, pfrazee, devinivy, estrattonbailey, matthieu-bluesky |
| Keywords | atproto, lex, data, json, encoding, utilities |

## Links

- npm: https://www.npmjs.com/package/@atproto/lex-json
- Repository: https://github.com/bluesky-social/atproto
- Homepage: https://atproto.com
- npm.io page: https://npm.io/package/@atproto/lex-json

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^2.8.1
- [@atproto/lex-data](https://npm.io/package/@atproto/lex-data.md) ^0.1.7

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.1.6 (latest) — 2026-08-03
- 0.0.0-spaces-alpha-20260915164701 (alpha) — 2026-09-15
- 0.1.0-next.0 (next) — 2026-05-18
- 0.0.0-spaces-alpha-20260913191958 — 2026-09-13
- 0.0.0-spaces-alpha-20260910230440 — 2026-09-10
- 0.0.0-spaces-alpha-20260910223605 — 2026-09-10
- 0.0.0-spaces-alpha-20260910222405 — 2026-09-10
- 0.0.0-spaces-alpha-20260910214032 — 2026-09-10
- 0.1.5 — 2026-07-31
- 0.1.4 — 2026-07-07
- 0.1.3 — 2026-07-01
- 0.1.2 — 2026-06-25
- 0.1.1 — 2026-06-16
- 0.1.0 — 2026-05-19
- 0.0.16 — 2026-04-15
- … 16 more at https://npm.io/package/@atproto/lex-json/versions

## README

# @atproto/lex-json

- [Changelog](./CHANGELOG.md)
- [`@atproto/lex` documentation](https://github.com/bluesky-social/atproto/blob/main/packages/lex/lex/README.md)

JSON encoding and decoding for the AT Protocol [data model](https://atproto.com/specs/data-model), including the `$link` (CID) and `$bytes` representations used by [XRPC](https://atproto.com/specs/xrpc).

Provides `lexParse` / `lexStringify` to go between JSON strings and data-model values, and `jsonToLex` / `lexToJson` to convert already-parsed JSON objects. For the CBOR codec used by repository storage, see [`@atproto/lex-cbor`](https://github.com/bluesky-social/atproto/tree/main/packages/lex/lex-cbor).

This is a building block of [`@atproto/lex`](https://github.com/bluesky-social/atproto/tree/main/packages/lex/lex), which re-exports it — prefer depending on that package.

## License

This project is dual-licensed under MIT and Apache 2.0 terms:

- MIT license ([LICENSE-MIT.txt](https://github.com/bluesky-social/atproto/blob/main/LICENSE-MIT.txt) or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0, ([LICENSE-APACHE.txt](https://github.com/bluesky-social/atproto/blob/main/LICENSE-APACHE.txt) or http://www.apache.org/licenses/LICENSE-2.0)

Downstream projects and end users may chose either license individually, or both together, at their discretion. The motivation for this dual-licensing is the additional software patent assurance provided by Apache 2.0.

---
_Source: https://npm.io/package/@atproto/lex-json · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
