Socket
Socket
Sign inDemoInstall

@node-wot/core

Package Overview
Dependencies
23
Maintainers
5
Versions
39
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @node-wot/core

W3C Web of Things (WoT) Servient framework


Version published
Weekly downloads
101
decreased by-9.82%
Maintainers
5
Install size
11.8 MB
Created
Weekly downloads
 

Readme

Source

Core of node-wot

The core of node-wot is the entry point allowing to attach dedicated bindings such as:

  • HTTP
  • CoAP
  • ...

or to create user-specific bindings.

Current Maintainer(s): @danielpeintner @relu91 @JKRhb

Prerequisites

  • npm install @node-wot/core

Examples

see binding examples such as

Codecs

Octet-Stream

The octet-stream codec enables deserialization and serialization of binary data. To encode and decode sequences of bytes, the octet-stream codec uses the following content type parameters:

ParameterDescriptionDefault
lengthNumber of bytes produced during serialization or consumed during deserialization
signedSignedness of the data type, true or falsetrue
byteSeqEndianness, enum of BIG_ENDIAN, LITTLE_ENDIAN, BIG_ENDIAN_BYTE_SWAP, LITTLE_ENDIAN_BYTE_SWAPBIG_ENDIAN

Additionally, the octet-stream codec supports the data schema terms below for addressing bit-fields:

TermDescriptionDefault
ex:bitLengthNumber of bits produced during serialization or consumed during deserialization
ex:bitOffsetOffset in bits from the beginning of the byte sequence0

With the help of the terms and parameters above, the octet-stream codec can be used to serialize and deserialize objects containing bit-fields and sequences of bytes, like in the following example.

Example

To serialize the object { flag1: true, numberProperty: 99, stringProperty: "Web" } to a sequence of bytes, the content type application/octet-stream;length=4;signed=false;, along with the following data schema can be used:

{
    "type": "object",
    "properties": {
        "flag1": { "type": "boolean", "ex:bitOffset": 0, "ex:bitLength": 1 },
        "numberProperty": { "type": "integer", "ex:bitOffset": 1, "ex:bitLength": 7 },
        "stringProperty": { "type": "string", "ex:bitOffset": 8, "ex:bitLength": 24 }
    }
}

More Details

See https://github.com/eclipse-thingweb/node-wot/

FAQs

Last updated on 11 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc