GithubHelp home page GithubHelp logo

nordicsemiconductor / lwm2m-types-js Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 3.39 MB

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

Home Page: https://github.com/NordicSemiconductor/lwm2m-types-js#readme

License: BSD 3-Clause "New" or "Revised" License

TypeScript 99.95% Shell 0.01% JavaScript 0.03%
nrf-asset-tracker lwm2m json-schema

lwm2m-types-js's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.