DEV Community

Cover image for Node.js the doppelgängers 🎭
Adam Crockett 🌀
Adam Crockett 🌀

Posted on

Node.js the doppelgängers 🎭

Imitation falls sincerely flat

Or does it?

Excluding deno, there are a handful of node.js like projects I have encountered in my travels, some are just node with a different engine, eg no WebKit, others are heavily inspired by and feel close to node, but under the hood, they are totally different beasts.

Because node.js isn't always perfect for everything (it's true!) there are plenty of reasons to try out these doppelgängers for very focused use cases.

Language category:

Java ♨️

I once said that Java wanted to be JavaScript and I cited all the above engines and Mozilla's history to show why that's true. If you are ever unfortunate enough to work in Mozilla's RhinoJS 🦏 but long for node.js like the rest of the world uses, you might find RingoJS a touch more comfortable, built on Rhino, it's not perfect but it does have a node.js like stdlib and some other old friends.

C 📼

  • IOT.js If you want node.js with a super light memory footprint then you have to ditch WebKit. IOT.js is probably the way to go, written in C with the Jerryscript C engine it's able to run on your smart fridge at lightning ⚡ speeds, it has the writing feel of node.js if it where stuck in es5 with some limitations but the stdlib is mostly there. I was actually writing an OS using IOT.js as the application process per each app communicating to a node.js controlling process, good fun.

JavaScript 🏚️

  • IO.js Similar name to the one above, IO.js It's old but this was a fork of node.js when node.js was really behind with it's features, the story goes that IO.js forked because people where frustrated by node.js development speed, and so a group of people added a bunch of features that node.js lacked at the time, then one day they merged together again, I can't remember the details 🤷‍♂️. I wish more stuff would merge together

Lua 🌕

I love Lua, I know I shouldn't maybe, but I do, when I found out that Lua had a package manager I wondered if it compared to npm, naturally I looked for node js Lua type projects and found luvit which is a node.js inspired project, this project provides the same libuv (the best programming logo of all time) backend for asynchronous I/O for Lua.

local http = require('http')

http.createServer(function (req, res)
  local body = "Hello world\n"
  res:setHeader("Content-Type", "text/plain")
  res:setHeader("Content-Length", #body)
  res:finish(body)
end):listen(1337, '127.0.0.1')

print('Server running at http://127.0.0.1:1337/')
Enter fullscreen mode Exit fullscreen mode

Look it's a Lua http server example you might sort of recognise it if you squint?

Wrapping up 💝

Well the last one I can think of, trident engine was Microsoft edges engine pre WebKit and despite the bad wrap, it's actually a really good, light and perfomant engine, I can't find the project now but there is a node.js on trident floating around on the internet, even though the browser is dead and born again, it's engine actually lives on in that.

Do you know of any pretenders? Let me know in the comments!

Top comments (0)