Giter Club home page Giter Club logo

txiki.js's Introduction

txiki.js โ€” The tiny JavaScript runtime

Build Status

Overview

txikia (basque): small, tiny.

txiki.js is a small and powerful JavaScript runtime. It's built on the shoulders of giants: it uses QuickJS as its JavaScript engine, libuv as the platform layer, wasm3 as the WebAssembly engine and curl as the HTTP client.

Features

Web Platform APIs

(1): All of them are async.

(2): No subtle support.

(3): No tables, globals or memory support.

Runtime features

  • TCP and UDP sockets
  • Unix sockets / named pipes
  • Signal handling
  • File operations
  • Child processes
  • DNS (getaddrinfo)
  • WASI
  • Miscellaneous utility functions

See the full API documentation.

Other extras:

  • Import directly from HTTP(S) URLs
  • Import JSON files
  • BigFloat and BigDecimal extensions

Standard library

The builtin @tjs/std module exports the following:

ffi

The builtin @tjs/ffi module provides access to FFI functionality.

Supported platforms

  • GNU/Linux
  • macOS
  • Windows (beta)
  • Other Unixes (please test!)

Building

CMake is necessary.

NOTE: The txiki.js build depends on a number of git submodules (e.g. libuv, wasm3). If you didn't already clone this repository recursively, make sure you initialize these submodules with git submodule update --init before proceeding to the build.

Unix systems

# Get the code
git clone --recursive https://github.com/saghul/txiki.js --shallow-submodules && cd txiki.js
# Compile it!
make
# Run the REPL
./build/tjs

Windows (beta)

Windows support it's currently considered beta. Tests do pass, but building it is not as easy as it should be.

Building has only been tested in 64bit Windows.

Prerequisites

First make sure you have MSYS2 installed. The mingw64 and clang64 environments are currently tested.

Then install the required dependencies:

pacman -S git make pactoys
pacboy -S curl-winssl:p toolchain:p cmake:p ninja:p

Build

These commands must be run in a MinGW64 or clang64 shell.

make

This will build the executable just like on Unix. Note that at this point there are a number of dynamically linked libraries, so if you want to use the executable on a different system you'll need to copy those too. Check the list with ldd build/tjs.exe.

Running the tests

Make sure these commands are run from Windows Terminal (mintty, what MSYS2 provides is not supported).

make test

Versioning

At this time txiki.js uses calendar versioning with the form YY.MM.MICRO.

Thanks

txiki.js stands on shoulders of giants. It wouldn't be what it is today without these libraries:

  • QuickJS: JavaScript engine
  • libuv: platform abstraction layer
  • wasm3: WASM engine
  • curl: HTTP client
  • [libffi]: Call native functions from C

In addition, txiki.js has these contributors to thank for their help.

Thank you all for making this project possible!

txiki.js's People

Contributors

saghul avatar samuelbrian avatar dependabot[bot] avatar thebrokenrail avatar lal12 avatar bnoordhuis avatar vladimyr avatar lmangani avatar guest271314 avatar stevefan1999-personal avatar vr5 avatar tbmale avatar johnrobinsn avatar doodlewind avatar sxs7513 avatar rickyes avatar lulzx avatar juanarbol avatar humphd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.