# @nordicsemiconductor/lwm2m-types

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

Latest version **2.7.0** (published 2023-10-31) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install @nordicsemiconductor/lwm2m-types
pnpm add @nordicsemiconductor/lwm2m-types
yarn add @nordicsemiconductor/lwm2m-types
bun add @nordicsemiconductor/lwm2m-types
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.7.0 |
| Published | 2023-10-31 |
| First published | 2022-11-29 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=20 |
| Dependencies | 1 |
| Unpacked size | 2.7 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Nordic Semiconductor ASA \| nordicsemi.no |
| Maintainers | aadnekar, ken.redergard, bencefr, bihanssen, nordicsemi, asset-tracker-cloud-ci, chfa.nordicsemi.no |
| Keywords | nrf-asset-tracker, lwm2m, json-schema |

## Links

- npm: https://www.npmjs.com/package/@nordicsemiconductor/lwm2m-types
- Repository: https://github.com/NordicSemiconductor/lwm2m-types-js
- Homepage: https://github.com/NordicSemiconductor/lwm2m-types-js#readme
- Issues: https://github.com/NordicSemiconductor/lwm2m-types-js/issues
- npm.io page: https://npm.io/package/@nordicsemiconductor/lwm2m-types

## Dependencies (1)

- [ajv](https://npm.io/package/ajv.md) 8.12.0

## 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

- 2.7.0 (latest) — 2023-10-31
- 2.6.1 — 2023-09-12
- 2.6.0 — 2023-09-12
- 2.5.1 — 2023-08-23
- 2.5.0 — 2023-07-06
- 2.4.1 — 2023-06-21
- 2.4.0 — 2023-06-19
- 2.3.3 — 2023-05-31
- 2.3.2 — 2023-05-31
- 2.3.1 — 2023-05-16
- 2.3.0 — 2023-04-26
- 2.2.0 — 2023-04-26
- 2.1.3 — 2023-03-20
- 2.1.2 — 2023-01-24
- 2.1.1 — 2023-01-20
- … 10 more at https://npm.io/package/@nordicsemiconductor/lwm2m-types/versions

## README

# LwM2M TypeScript type definitions and JSON schema [![npm version](https://img.shields.io/npm/v/@nordicsemiconductor/lwm2m-types.svg)](https://www.npmjs.com/package/@nordicsemiconductor/lwm2m-types)

[![Test and Release](https://github.com/NordicSemiconductor/lwm2m-types-js/actions/workflows/test-and-release.yaml/badge.svg)](https://github.com/NordicSemiconductor/lwm2m-types-js/actions/workflows/test-and-release.yaml)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com)
[![Mergify Status](https://img.shields.io/endpoint.svg?url=https://api.mergify.com/v1/badges/NordicSemiconductor/lwm2m-types-js)](https://mergify.io)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier/)
[![ESLint: TypeScript](https://img.shields.io/badge/ESLint-TypeScript-blue.svg)](https://github.com/typescript-eslint/typescript-eslint)

TypeScript type definitions and JSON schema for the objects defined in the
[LwM2M Object Registry](https://github.com/OpenMobileAlliance/lwm2m-registry).

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

## Installation

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

## Usage

See [example.ts](./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](./known-good-shadow.json)

## Building the types

```bash
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
```

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