LivnyJS
Ello \o
Livny is a modern JavaScript and TypeScript runtime built on top of Rust, Golang and the GraalVM Polyglot infrastructure that can run all of Deno and Node.jS applications. It is fine-tuned for user satisfaction, performance and security.
How do I get started with it?
First of all, welcome! We offer some cookies and sometimes pigs around here.
Windows
For Windows users, we provide a Windows installer in our releases section. Although Livny is also available through winget
winget install livny
or through choco
choco install livny
MacOS
For MacOS users, we provide a Homebrew tap and you can simply install Livny using it.
brew install livny
Linux distributions
For Linux users, we provide a package in most Linux distributions.
Debian/Ubuntu
sudo apt install livnyjs
Arch
yay -S livnyjs # We're assuming you're using yay as your AUR helper.
OpenSUSE Leap/Tumbleweed
sudo zypper in livnyjs
Fedora
sudo dnf install livnyjs
What makes Livny so fancy mate?
-
High-performance TypeScript out of the box using the INSERT_NAME_HERE TypeScript compiler and type checker made in Golang.
-
Uses the high-performance Graal.JS JavaScript engine.
-
Can integrate perfectly with other programming languages (Take a peek at Mesh Mode).
-
A really fast WASM front-end powered by Graal.WASM to mix and match with even more languages!
-
One runtime to rule them all. Livny can run all Deno and NodeJS libraries and applications, even meshed together. Have that one darn Node library that just isn't Deno compatible but you just like Deno's developer experience? Livny's got your back.
-
Livny packs a punch with industry standard developer utilities to make your experience as smooth as possible. This includes
- A TypeScript compiler and typechecker.
- A linter
- A test suite manager
- A build system
- A code formatter
-
Merge everything into a single JavaScript file using Livny-pack and push to prod in a matter of seconds!
Livny's module management system
Installing Livny piglets
To install a Livny piglet, simply do livny install
and it will install it!
You can use that piglet from anywhere now by performing an import statement like
import { notify } from "[email protected]";
and installing the notify piglet by livny install notify
And that's.. it! No node_modules, no package.json, no meta data junk.
But what if I run an application which uses a piglet which I do not have installed?
Livny automagically detects dependencies which aren't installed on the system and will prompt you if you want to continue installing them.
For those who want curious -- Livny stores modules in a directory called .piglets
But wait, that's not it!
Livny is smart. It automatically keeps an index of piglet loads and it will clean up unused/barely used piglets after 30 days.
This setting can be changed by
# Changing the time period
livny settings cleanup_period 2m # Two months.
# Disabling this behavior
livny settings cleanup false # true by default.
Installing NodeJS modules
If you're using Mesh mode want to use NPM modules, simply use npm how you would normally but do livny npm
instead of npm
alone.
You can also add external package managers like
- Yarn
- PNPM
By doing livny settings node_pm yarn
or livny settings node_pm pnpm
Psst... Tired of writing livny npm
or livny yarn
again and again? Simply do this!
livny settings node_pm_alias true # False by default.
This will add aliases/links to the Node package manager installed. So you can now run npm
or yarn
alone just fine! :)