KobiMorad / node-red-contrib-typescript-node

Create your Node-RED nodes by extending a TypeScript class.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node-RED TypeScript Node

Node-RED TypeScript Node is a small library for writing Node-RED nodes using TypeScript. It allows the use of classes by extending the main class Node and makes use of the TypeScript type definitions for Node-RED. Most method are just easier-to-use wrappers around RED.nodes functions.

Examples are available in the examples directory.

⚠️ Warning ⚠️

This library is still in its very initial stages. As such, tread with caution.

API

Node

Node(RED: Red)

Node-RED Node class that receives a Red instance as constructor. Custom nodes should extend this class.

Node.createNode(config: NodeProperties): void

Creates a node using the config given. Equivalent to RED.nodes.createNode().

static Node.registerType

Registers the current class as a Node-RED node. Equivalent to RED.nodes.registerType.

Credits

This was based on the TypeScript-Node-Starter template by Microsoft.

About

Create your Node-RED nodes by extending a TypeScript class.

License:MIT License


Languages

Language:TypeScript 91.1%Language:JavaScript 8.9%