DEV Community

Looking for a lightweight nodejs project

Adam Crockett 🌀 on December 11, 2019

Basically what the title says, looking for a fork of node js that takes less memory per process, basic io and es6 support are both nice to haves. What are my options?

Collapse
 
deciduously profile image
Ben Lovy

I think for certain workloads deno may be appropriate, but low memory footprint isn't necessarily a primary goal.

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

Ahh yes, been there, Deno is great in terms of goals but it's not ready, it doesn't have compatibility with node modules (yet?) Understandable really. I'm rather stupidly working on a Linux desktop environment in js and would have loved to use it but developers from all over JavaScript land should be able to extend this thing. I am trying to spawn node processes and embed that into an electron like environment (lighter) but the node processes weigh in at 8mb with nothing but runtime.

I am looking at ms edge chacracore on node which is supposed to be better, we shall see.

Collapse
 
deciduously profile image
Ben Lovy

Color me intrigued

Thread Thread
 
adam_cyclones profile image
Adam Crockett 🌀

IL let you know when I have a repo, the plan is to use rust WASM to do heavy lifting, even run on the Kernal because apparently that's a thing haha

Thread Thread
 
deciduously profile image
Ben Lovy

Wasm is the coolest new thing.

Thread Thread
 
adam_cyclones profile image
Adam Crockett 🌀

100% hip and cool, I just want to do some rust in Wasm which sounds really appealing. An entire desktop that is super portable, powered by the future and unicorns.

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

Saying that, I could just use it and wait for said compatibility.

Also I am a little unsure how safe it is the way Deno imports over Https and does that get cached.

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

The answer was not ChakraCore which weighed 7mb over v8 at 8m.

Iot.js weighs 512kb!
iotjs.net/

Now I can spawn inexpensive node.js (ish) processes that can act as TCP clients. In other words, killing this process kills the window in my is desktop environment.

Limitations so far, es5 so I will have to keep that in mind and the API reference is similar but not nodes.

Either way I can provide very simple io and process management, this is one step closer to a real js desktop for Linux.

Collapse
 
vonheikemen profile image
Heiker

Is this what you are looking for ECMAScript engines?

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

It's certainly a good list for inspiration.

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

I am looking more for a node.js that somebody forked and is maintaing, its probably a fork of node designed for iot devices. However as Ben in the comments puts it Rust is the answer perhaps.

 
adam_cyclones profile image
Adam Crockett 🌀

Okay your points are valid I must say it puts my mind at rest somewhat, so how could I go about using libraries from the JavaScript ecosystem that have not been authored for Deno but may have typescript support. Deno's lack of developer ecosystem (as far as I can tell) means it's not ready for me just yet.

 
adam_cyclones profile image
Adam Crockett 🌀

Hmmm you have peeked my interest again, I will try it out again tonight. I'm going to need to create some sort of webview for my deaktop environment project. I was using the electron like runtime nw.js but perhaps Deno comunity has an equivalent?

 
adam_cyclones profile image
Adam Crockett 🌀

github.com/tauri-apps/tauri/blob/d... looks interesting 🥳