npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@vilic/matter.js

v0.5.1-alpha.0-20231005-d8f807e.1

Published

Matter protocol in pure js

Downloads

71

Readme

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:

| Export | Description | |-----------------------------------------|-------------------------------------------------------------------------------------------------| | @project-chip/matter.js | Exports the API to implement a Device or a Controller. | | @project-chip/matter.js/certificate | Exports Certificate (Root-/PAA/PAI/IAC/DA-Certificates) related functionality | | @project-chip/matter.js/cluster | Exports Matter Cluster definitions and Default Cluster-Handlers | | @project-chip/matter.js/codec | Exports Codecs for e.g. Matter-Messages | | @project-chip/matter.js/common | Exports certain common functionalities | | @project-chip/matter.js/crypto | Exports Crypto related abstract functionality that needs to be implemented platform specific! | | @project-chip/matter.js/datatype | Exports Matter Data types | | @project-chip/matter.js/fabric | Exports Matter-Fabric functionality | | @project-chip/matter.js/interaction | Exports Matter Interaction protocol functionality | | @project-chip/matter.js/log | Exports Logging functionality (based on "console") | | @project-chip/matter.js/math | Exports Math functionality used by Matter | | @project-chip/matter.js/mdns | Exports Basic MDNS functionality (uses Network implementation) | | @project-chip/matter.js/model | Exports a JavaScript version of the Matter data model | | @project-chip/matter.js/net | Exports Basic Network abstract functionality that needs to be implemented platform specific! | | @project-chip/matter.js/protocol | Exports Basic Matter protocol functionality | | @project-chip/matter.js/schema | Exports Schema definitions and functionality | | @project-chip/matter.js/securechannel | Exports Secure Channel functionality | | @project-chip/matter.js/session | Exports Session and Secure-Session functionality | | @project-chip/matter.js/spec | Exports Matter Specification References | | @project-chip/matter.js/storage | Exports Basic Storage abstract functionality that needs to be implemented platform specific! | | @project-chip/matter.js/time | Exports Basic Time/Timer abstract functionality that needs to be implemented platform specific! | | @project-chip/matter.js/tlv | Exports Matter TLV type definitions | | @project-chip/matter.js/util | Exports 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