Node-RED IcedCoffeeScript Node

1.0.7 · abandoned · verified Sun Apr 19

The `node-red-iced-coffeescript` package provides a custom node for the Node-RED low-code programming platform, enabling users to execute code written in IcedCoffeeScript within their flows. Node-RED is an open-source tool for wiring together hardware devices, APIs, and online services in event-driven applications, often used for IoT and automation. IcedCoffeeScript is a superset of CoffeeScript that introduced `await` and `defer` keywords for simplified asynchronous control flow, predating the native `async/await` features in modern JavaScript. This package, currently at version 1.0.7, effectively allows Node-RED flows to leverage IcedCoffeeScript's asynchronous syntax. However, given its last update was approximately nine years ago, and `iced-coffee-script` itself has not been updated in six years, the package is considered abandoned. Its primary differentiator, async handling, has been largely superseded by standard JavaScript capabilities. The package requires `iced-coffee-script` to be installed separately.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart guides you through setting up Node-RED, installing the `iced-coffee-script` compiler and the `node-red-iced-coffeescript` node, and demonstrates creating a basic Node-RED flow to execute simple IcedCoffeeScript code.

# 1. Install Node-RED (if not already installed)
sudo npm install -g --unsafe-perm node-red

# 2. Start Node-RED
node-red

# 3. In a new terminal, install the IcedCoffeeScript compiler globally (as recommended by the package README)
sudo npm install -g iced-coffee-script

# 4. Install the Node-RED IcedCoffeeScript node
npm install node-red-iced-coffeescript

# 5. Restart Node-RED to load the new node
node-red

// 6. Access the Node-RED editor (usually http://localhost:1880)
// 7. Drag an 'Inject' node, an 'iced-coffeescript' node, and a 'Debug' node onto the canvas.
// 8. Wire them together: Inject -> iced-coffeescript -> Debug.

// 9. Double-click the 'iced-coffeescript' node to edit its code.
//    Replace the default content with the following IcedCoffeeScript example:

# IcedCoffeeScript code for the node:
msg.payload = "Hello, IcedCoffeeScript!"

# Example of IcedCoffeeScript's async features (for context, if `defer` was relevant)
# Not directly executable without an async operation, but demonstrates the syntax.
# Assuming 'someAsyncFunction' exists and takes a callback:
# someAsyncFunction (value) defer cb value
# msg.payload = "Async operation result: #{value}"

return msg

// 10. Deploy the flow.
// 11. Click the 'Inject' node button. Observe the output in the Debug sidebar.

view raw JSON →