@nordicsemiconductor/lwm2m-types
TypeScript icon, indicating that this package has built-in type declarations

2.7.0 • Public • Published

LwM2M TypeScript type definitions and JSON schema npm version

Test and Release semantic-release Renovate Mergify Status Commitizen friendly code style: prettier ESLint: TypeScript

TypeScript type definitions and JSON schema for the objects defined in the LwM2M Object Registry.

This is useful if you need to validate a JSON representation of those objects.

Installation

npm ci
// Clone LwM2M object registry
git clone https://github.com/OpenMobileAlliance/lwm2m-registry.git --depth 1
npm test

Usage

See example.ts

JSON document structure

LwM2M values are encoded as a JSON document, where the key is an extended version of the LwM2M URN: <ObjectID>:<ObjectVersion>@<LwM2MVersion> (where ObjectVersion and/or LwM2MVersion can be omitted if it is 1.0).

Example

Building the types

git clone https://github.com/OpenMobileAlliance/lwm2m-registry.git --depth 1
npx tsx cli/generate-types.ts
npx tsx cli/generate-json-schema.ts
# Format the source
npx prettier --write ./
# Make sure result compiles
npx tsc
# Compile JS exports
npx swc -d types-dist ./types
# Make sure example runs
npx tsx ./example.ts

Dependencies (1)

Dev Dependencies (23)

Package Sidebar

Install

npm i @nordicsemiconductor/lwm2m-types

Weekly Downloads

6

Version

2.7.0

License

BSD-3-Clause

Unpacked Size

2.88 MB

Total Files

715

Last publish

Collaborators

  • aadnekar
  • ken.redergard
  • bencefr
  • bihanssen
  • nordicsemi
  • asset-tracker-cloud-ci
  • chfa.nordicsemi.no