Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ipld-schema-describer

rvagg122Apache-2.03.0.20TypeScript support: included

IPLD Schema Describer

IPLD, Schema

readme

ipld-schema-describer

Describe JavaScript object forms using IPLD Schemas.

Example

import { describe } from 'ipld-schema-describer'
import schemaPrint from 'ipld-schema/print.js'

const obj = {
  foo: [1, 'one', true],
  bar: [1, 2, 3, 4],
  baz: 'baz'
}

const { schema, root } = describe(obj)
console.log(schemaPrint(schema))
console.log('\nRoot:', root)

Prints:

type Struct_1 struct {
  f0 Int
  f1 String
  f2 Bool
} representation tuple

type List_1 [Int]

type Struct_2 struct {
  foo Struct_1
  bar List_1
  baz String
}

Root: Struct_2

Limitations

Objects must conform to the IPLD Data Model, so undefined is not supported and complex objects such as Date, RegExp and others should be avoided. Circular references are also not supported.

The resulting IPLD Schema is only able to describe the raw representation layout. IPLD Schemas are capable of describing complex shapes that cannot be inferred without additional information. Unions and Enums in particular are not able to be inferred. The Schema output from this library can be used as the basis of the formation of a more correct and concice Schema for any data layout. Read more in the IPLD Schemas documentation.

Copyright 2020 Rod Vagg

Licensed under Apache 2.0 (LICENSE-APACHE / http://www.apache.org/licenses/LICENSE-2.0)

changelog

3.0.20 (2025-12-04)

Trivial Changes

  • deps: bump actions/checkout from 5 to 6 (#59) (b17d185)
  • deps: bump actions/setup-node from 6.0.0 to 6.1.0 (#60) (d1be84a)

3.0.19 (2025-10-14)

Trivial Changes

  • deps: bump actions/setup-node from 5.0.0 to 6.0.0 (#58) (bfb0bb3)

3.0.18 (2025-09-04)

Trivial Changes

  • deps: bump actions/setup-node from 4.4.0 to 5.0.0 (#57) (762e3d1)

3.0.17 (2025-08-25)

Trivial Changes

  • deps-dev: bump chai from 5.3.3 to 6.0.1 (#56) (e97803a)

3.0.16 (2025-08-13)

Trivial Changes

  • deps: bump actions/checkout from 4 to 5 (#55) (08cd313)
  • remove specific node.js versions from CI (06429a2)

3.0.15 (2025-04-14)

Trivial Changes

  • deps: bump actions/setup-node from 4.2.0 to 4.4.0 (f8c2983)

3.0.14 (2025-01-28)

Trivial Changes

  • deps: bump actions/setup-node from 4.1.0 to 4.2.0 (d25fae3)

3.0.13 (2024-12-03)

Trivial Changes

  • deps-dev: bump mocha from 10.8.2 to 11.0.1 (b386d94)

3.0.12 (2024-10-25)

Trivial Changes

  • deps: bump actions/setup-node from 4.0.4 to 4.1.0 (644773d)

3.0.11 (2024-09-25)

Trivial Changes

  • deps: bump actions/setup-node from 4.0.3 to 4.0.4 (701b324)

3.0.10 (2024-07-10)

Trivial Changes

  • deps: bump actions/setup-node from 4.0.2 to 4.0.3 (a42a985)

3.0.9 (2024-06-11)

Trivial Changes

  • deps-dev: bump c8 from 9.1.0 to 10.0.0 (36ee806)

3.0.8 (2024-02-08)

Trivial Changes

  • deps: bump actions/setup-node from 4.0.1 to 4.0.2 (bfb3e97)

3.0.7 (2024-01-29)

Trivial Changes

3.0.6 (2024-01-04)

Trivial Changes

  • deps-dev: bump c8 from 8.0.1 to 9.0.0 (2f8adee)

3.0.5 (2024-01-01)

Trivial Changes

  • deps: bump actions/setup-node from 4.0.0 to 4.0.1 (6a8fd9c)

3.0.4 (2023-10-25)

Trivial Changes

  • deps: bump actions/checkout from 3 to 4 (bc99fcd)
  • deps: bump actions/setup-node from 3.8.1 to 4.0.0 (46971d0)

3.0.3 (2023-08-18)

Trivial Changes

  • deps: bump actions/setup-node from 3.8.0 to 3.8.1 (a10f4ec)

3.0.2 (2023-08-15)

Trivial Changes

  • deps: bump actions/setup-node from 3.7.0 to 3.8.0 (8c9bd34)

3.0.1 (2023-07-07)

Trivial Changes

  • deps-dev: bump c8 from 7.14.0 to 8.0.0 (628899f)

3.0.0 (2023-07-07)

⚠ BREAKING CHANGES

  • drop node 14.x support, add 18.x and current

Trivial Changes

  • deps-dev: bump typescript from 4.9.5 to 5.0.2 (0ebf508)
  • deps: bump actions/setup-node from 3.6.0 to 3.7.0 (51a2712)
  • drop node 14.x support, add 18.x and current (313d283)

2.0.1 (2023-01-06)

Trivial Changes

  • deps: bump actions/setup-node from 3.5.1 to 3.6.0 (#33) (b45e364)
  • no-release: bump actions/setup-node from 3.4.1 to 3.5.0 (#31) (b2eab03)
  • no-release: bump actions/setup-node from 3.5.0 to 3.5.1 (#32) (4e66571)

2.0.0 (2022-08-16)

⚠ BREAKING CHANGES

  • publish as ESM-only
  • update dependencies, upgrade schema DMT & library usage

Features

  • publish as ESM-only (ea4a423)
  • update dependencies, upgrade schema DMT & library usage (c236af1)

Bug Fixes

Trivial Changes

  • no-release: bump actions/setup-node from 3.1.1 to 3.2.0 (#24) (81caebc)
  • no-release: bump actions/setup-node from 3.2.0 to 3.3.0 (#25) (4da7e2c)
  • no-release: bump actions/setup-node from 3.3.0 to 3.4.0 (#27) (a6d1ecb)
  • no-release: bump actions/setup-node from 3.4.0 to 3.4.1 (#28) (18bd605)

1.0.10 (2022-05-03)

Trivial Changes

  • deps-dev: bump mocha from 9.2.2 to 10.0.0 (821e3e7)
  • deps: bump ipld-schema from 1.1.6 to 2.0.1 (129962f)
  • no-release: bump actions/checkout from 2.4.0 to 3 (#18) (745c567)
  • no-release: bump actions/setup-node from 2.5.0 to 2.5.1 (#16) (2df4709)
  • no-release: bump actions/setup-node from 2.5.1 to 3.0.0 (#17) (34aaaf8)
  • no-release: bump actions/setup-node from 3.0.0 to 3.1.0 (#19) (a6965ba)
  • no-release: bump actions/setup-node from 3.1.0 to 3.1.1 (#20) (6851b6c)
  • no-release: bump polendina from 2.0.15 to 3.0.0 (#23) (44570a3)
  • no-release: bump standard from 16.0.4 to 17.0.0 (#21) (baf8f6c)

1.0.9 (2021-12-08)

Trivial Changes

  • deps-dev: bump polendina from 1.1.1 to 2.0.0 (#15) (8cd6797)
  • no-release: bump actions/checkout from 2.3.4 to 2.4.0 (#13) (e13e0ba)
  • no-release: bump actions/setup-node from 2.4.1 to 2.5.0 (#14) (7ed1d18)

1.0.8 (2021-09-28)

Trivial Changes

  • deps: bump actions/setup-node from 2.4.0 to 2.4.1 (084039f)

1.0.7 (2021-08-06)

Trivial Changes

  • deps: bump actions/setup-node from 2.3.2 to 2.4.0 (330e408)

1.0.6 (2021-08-05)

Trivial Changes

  • deps: bump actions/setup-node from 2.3.1 to 2.3.2 (5753f6f)

1.0.5 (2021-08-04)

Trivial Changes

  • deps: bump actions/setup-node from 2.3.0 to 2.3.1 (15bd94b)

1.0.4 (2021-07-28)

Trivial Changes

  • deps: bump actions/setup-node from 2.2.0 to 2.3.0 (49cdefb)
  • update deps, fix build for latest ipjs (8bef720)

1.0.3 (2021-07-01)

Trivial Changes

  • deps: bump actions/setup-node from 2.1.5 to 2.2.0 (c892d3a)

1.0.2 (2021-06-25)

Bug Fixes

1.0.1 (2021-06-25)

Bug Fixes

1.0.0 (2021-06-25)

⚠ BREAKING CHANGES

  • add typing, remove default exports

Features

  • add typing, remove default exports (d972251)

Bug Fixes

  • separate, minimal windows test run (31e8d18)

Trivial Changes

  • add semantic release & dependabot (8550947)