0.8.1 • Published 2 days ago

@project-chip/matter.js v0.8.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 days ago

matter.js

Implementation of Matter protocol in typescript with no native dependencies (and very limited dependencies).

This is the JavaScript only Core of the Matter protocol. It is used by other projects to implement Matter Nodes and Clients and add the relevant specific implementations for Network and other elements.

The following features are abstracted away to allow to be implemented environment specific:

  • Network (UDP/MDNS)
  • Crypto (to be split out)
  • Storage
  • Date/Timer
  • Logger (Default uses "console")

Exported functionality

This library exports the Matter protocol functionality as well as some helper functions as named exports:

ExportDescription
@project-chip/matter.jsExports the API to implement a Device or a Controller.
@project-chip/matter.js/certificateExports Certificate (Root-/PAA/PAI/IAC/DA-Certificates) related functionality
@project-chip/matter.js/clusterExports Matter Cluster definitions and Default Cluster-Handlers
@project-chip/matter.js/codecExports Codecs for e.g. Matter-Messages
@project-chip/matter.js/commonExports certain common functionalities
@project-chip/matter.js/cryptoExports Crypto related abstract functionality that needs to be implemented platform specific!
@project-chip/matter.js/datatypeExports Matter Data types
@project-chip/matter.js/fabricExports Matter-Fabric functionality
@project-chip/matter.js/interactionExports Matter Interaction protocol functionality
@project-chip/matter.js/logExports Logging functionality (based on "console")
@project-chip/matter.js/mathExports Math functionality used by Matter
@project-chip/matter.js/mdnsExports Basic MDNS functionality (uses Network implementation)
@project-chip/matter.js/modelExports a JavaScript version of the Matter data model
@project-chip/matter.js/netExports Basic Network abstract functionality that needs to be implemented platform specific!
@project-chip/matter.js/protocolExports Basic Matter protocol functionality
@project-chip/matter.js/schemaExports Schema definitions and functionality
@project-chip/matter.js/securechannelExports Secure Channel functionality
@project-chip/matter.js/sessionExports Session and Secure-Session functionality
@project-chip/matter.js/specExports Matter Specification References
@project-chip/matter.js/storageExports Basic Storage abstract functionality that needs to be implemented platform specific!
@project-chip/matter.js/timeExports Basic Time/Timer abstract functionality that needs to be implemented platform specific!
@project-chip/matter.js/tlvExports Matter TLV type definitions
@project-chip/matter.js/utilExports Basic Utility functionality

Both exports and the typings are exported as CommonJS and ES6 modules.

For more details please refer to the API Documentation.

Typescript note

To have Typescript and your IDE know all the relevant exported functionality you need to use the following in your tsconfig.json:

{
    "compilerOptions": {
        "moduleResolution": "node16", // Required to support package.json exports
        "module": "node16" // Required to make sure all imports are js
    }
}

matter.js usage

matter.js is used at the core of those two projects:

  • matternode: a light-weight node.js implementation of a Matter Node
  • matter-node.js: a Matter client / server running on node.js compatible with HA (Android / iOs support in progress)

Building

  • npm run build: Build all code and create CommonJS and ES6 variants in dist directory. This will built incrementally and only build the changed files.
  • npm run build-clean: Clean the dist directory and build all code from scratch

Tests

  • npm run test-node: Run tests in node.js
  • npm run test-web: Run tests in the browser
  • npm run test: Run all tests

test-web will create a /coverage directory containing the test code coverage

0.8.1

17 days ago

0.8.0

1 month ago

0.7.5

2 months ago

0.7.4

4 months ago

0.7.3

5 months ago

0.7.2

5 months ago

0.7.1

5 months ago

0.5.0

8 months ago

0.7.0

6 months ago

0.6.0

7 months ago

0.3.0

1 year ago

0.4.0

12 months ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago