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

@jackcarey/node-red-wasmer

v0.0.61

Published

Execute WebAssembly code within NodeRED.

Downloads

6

Readme

node-red-wasmer

Use WebAssembly files in NodeRED via wasmer-js.

Prerequisites

Node.js v16+

How to install

Follow the instructions on the NodeRED website, or run npm i @jackcarey/node-red-wasmer in your server directory.

How to use

Inputs

  1. Allowlist : allowlist (regex) : An allowed list of URL regular expression patterns.
  2. URL : url (string) : The address to fetch the WebAssembly file from.
  3. Function : functionName (string) : The name of the function to run.
  4. Standard Input : stdin (string) : Text to pass to the function after it first executes.
  5. Environment Variables : env (JSON) : Environment variables that can be accessed withing the function.
  6. Arguments : args (array[string]) : Arguments to pass into the function separated by spaces.
  7. Directories : dirs (JSON) : Virtual file paths made available to the module, and their contents.
  8. Age : maxHours (number) : The maximum number of hours before attempting to re-fetch the .wasm file.

Overriding Inputs: The following inputs can be overridden by passing them in msg.payload: url, functionName, stdin, args, dirs.

Outputs

Available inside msg.wasmer.

  1. Exit Code : exitCode (number) : The exit code of the function that ran.
  2. Standard Input : stdin (string) : The input buffer as a string.
  3. Standard Output : stdout (string) : The console output of the function that ran.
  4. StdErr : stderr (string) : Any error messages.
  5. Directories : dirs (JSON) : The path and contents of each virtual file.

Example Flow:

Check out the example flow:

[{"id":"133003c439760d95","type":"tab","label":"nodered-wasmer Example","disabled":false,"info":"","env":[]},{"id":"934b7209325e2a48","type":"inject","z":"133003c439760d95","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":40,"wires":[["c45792a03579023d"]]},{"id":"c45792a03579023d","type":"wasmer","z":"133003c439760d95","name":"","allowlist":"cb20093a9c91192e","url":"https://wasmer-js.pages.dev/demo.wasm","maxHours":72,"functionName":"demo","env":"{}","dirs":"{}","args":[],"x":250,"y":40,"wires":[["e900503182390afb"]]},{"id":"4f75ac69e9295bcb","type":"inject","z":"133003c439760d95","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":80,"wires":[["85169c18711cd456"]]},{"id":"85169c18711cd456","type":"wasmer","z":"133003c439760d95","name":"","allowlist":"cb20093a9c91192e","url":"https://wasmer-js.pages.dev/envvar.wasm","maxHours":72,"functionName":"envvar","env":"{\"ENV1\":\"one\",\"ENV2\":\"TWO\",\"DOG\":\"WOOF\",\"DOG_TYPE\":\"LABRADOR\"}","dirs":"{}","args":[],"x":250,"y":80,"wires":[["e900503182390afb"]]},{"id":"234baa9942ee8613","type":"inject","z":"133003c439760d95","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":160,"wires":[["572654faad6376db"]]},{"id":"572654faad6376db","type":"wasmer","z":"133003c439760d95","name":"","allowlist":"cb20093a9c91192e","url":"https://wasmer-js.pages.dev/mapdir.wasm","maxHours":72,"functionName":"mapdir","stdin":"","env":"{}","dirs":"{\"/a\":\"\",\"/b\":\"\",\"/file\":\"fileContents\"}","args":[],"x":250,"y":160,"wires":[["0b5801ca54f5c0d6"]]},{"id":"13caaf3e2449291d","type":"inject","z":"133003c439760d95","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":120,"wires":[["c3863094134224a6"]]},{"id":"c3863094134224a6","type":"wasmer","z":"133003c439760d95","name":"","allowlist":"cb20093a9c91192e","url":"https://wasmer-js.pages.dev/pipe_reverse.wasm","maxHours":72,"functionName":"pipe_reverse","stdin":"Hello world!","env":"{}","dirs":"{}","args":[],"x":270,"y":120,"wires":[["e900503182390afb"]]},{"id":"e900503182390afb","type":"debug","z":"133003c439760d95","name":"stdout","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"wasmer.stdout","targetType":"msg","statusVal":"","statusType":"auto","x":430,"y":80,"wires":[]},{"id":"0b5801ca54f5c0d6","type":"debug","z":"133003c439760d95","name":"wasmer","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"wasmer","targetType":"msg","statusVal":"","statusType":"auto","x":440,"y":160,"wires":[]},{"id":"cb20093a9c91192e","type":"urlAllowlist","name":"wasmer-js","mode":"and","flags":"gmi","pttns":"^https:\\/\\/wasmer-js.pages.dev\\/"}]