GithubHelp home page GithubHelp logo

eshost-cli's Introduction

eshost-cli

eshost-cli makes it easy to run and compare ECMAScript code uniformly across a number of runtimes. Support for runtimes is provided by the library eshost. Every host is initialized with the eshost runtime API available which provides a uniform way to print, create realms, and eval code.

See eshost's supported hosts for a list of hosts, download/build locations, and other information.

Usage

See --help output for the full details. Basic usage:

  • Add hosts using eshost --add <host name> <host type> <host path> --args <optional arguments>.
  • Automatically configure jsvu-installed hosts using eshost --configure-jsvu.
  • Eval an expression using eshost -e [1,2,3].length.
  • Execute a script using eshost path/to/script.js.

Examples

$ npm install -g eshost-cli
$ eshost --help
$ eshost --add <name> <type> <path to host executable> --args <optional arguments>
$ eshost -e "Map.length"

## chakra-es6
0

## d8
0

## chakra
0

## spidermonkey
1

## node
0

$ eshost --configure-jsvu --jsvu-prefix jsvu
$ eshost --tags jsvu-web -itsx "let a = 40+2; print(a)"

## Source
let a = 40+2; print(a)

┌──────────┬────┐
│ jsvu-ch  │ 42 │
│ jsvu-jsc │    │
│ jsvu-sm  │    │
│ jsvu-v8  │    │
└──────────┴────┘

Managing Hosts

You can --list, --add, --edit, and --delete hosts. Adding a host requires a name, type, and path to the runtime executable. You can optionally pass arguments using --args. The same host can be added multiple times with different --args which makes it easy to compare the output of runtimes given different options (e.g. by turning language features on and off).

Console hosts are either provided by the browser vendors or, more likely, built from source. The jsvu CLI makes it easy to install and update the most common JavaScript engine binaries.

Host types are those provided by eshost, namely:

  • node
  • ch
  • d8
  • jsshell
  • jsc
  • xs
  • nashorn
  • edge
  • chrome
  • firefox
  • safari

eshost-cli's People

Contributors

bnjmnt4n avatar bterlson avatar dilijev avatar mathiasbynens avatar michaelficarra avatar rwaldron avatar stefanpenner avatar

Watchers

 avatar  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.