sotoup / elsa

❄️ Elsa is a minimal, fast and secure runtime for Javascript and Typescript written in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Elsa

Travis Status Build Status - Badge Discord invite

Elsa is a minimal, fast and secure runtime for Javascript and Typescript written in Go, leveraging the power from QuickJS.

Features

  • URL based imports.
  • No fs, net access unless specified.
  • Compliant to web standards.
  • Supports TypeScript.
  • Module caching.
  • Bundle your script into a single file.
  • Create a standalone executable for your bundles.

Coming up

  • HTTP server, more Web APIs
  • Easy installation scripts
  • Standard modules

Install

Not yet released, build from source instead.

Build from source

You will need Go installed on your machine before building.

Install go-bindata using go get github.com/go-bindata/go-bindata/...

Clone the repo on your $GOPATH and run make build to trigger the build process.

Getting Started

Try running a simple program:

// hello.ts
import { hello } from "https://x.nest.land/arweave-hello@0.0.2/mod.ts";

hello("Elsa");
> elsa run hello.ts
Hello, Elsa

Contributing

Start by creating an issue about your feature or bug! Then, create a PR and we'll land it 😄

Credits

FAQs

Why choose QuickJS over V8?

QuickJS is a small and embeddable Javascript engine but it lacks V8's JIT for fast JavaScript execution. Although, it doesn't mean you cannot use Elsa on backends and CPU intensive tasks.

QuickJS has a better startup time than V8 so it would be a strong alternative for CLI apps and short-lived runs.

Looks like a QuickJS wrapper to me?

Technically, Node and Deno are also V8 wrappers. All do the same job, init engine - init ops - bundle - run. Most people don't realise that implementing native ops is what makes a runtime and not an interpreter.

What's the status of the project?

It is in it's very early stages of development i.e. nothing should be considered stable. Feel free to take it for a spin though :)

What does "minimal" actually refer to?

The goal is to fullfil the bare minimum requirements needed for development of a project. Elsa, although aims to be extendable via plugins. A few examples of features that are not likely to be included in Elsa are tools for formatting, linting and analysis.

In short, develop - package - ship

License

Elsa.land is licensed under MIT License.

About

❄️ Elsa is a minimal, fast and secure runtime for Javascript and Typescript written in Go

License:MIT License


Languages

Language:Go 94.8%Language:Makefile 4.0%Language:TypeScript 1.2%