Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elixirscript/elixirscript
Converts Elixir to JavaScript
https://github.com/elixirscript/elixirscript
compiler elixir javascript transpiler
Last synced: 29 days ago
JSON representation
Converts Elixir to JavaScript
- Host: GitHub
- URL: https://github.com/elixirscript/elixirscript
- Owner: elixirscript
- License: mit
- Created: 2015-02-01T21:22:05.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-08-20T14:46:14.000Z (about 5 years ago)
- Last Synced: 2024-10-04T16:38:47.081Z (about 1 month ago)
- Topics: compiler, elixir, javascript, transpiler
- Language: Elixir
- Homepage: https://elixirscript.github.io/
- Size: 3.62 MB
- Stars: 1,560
- Watchers: 44
- Forks: 67
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
## ElixirScript [![Documentation](https://img.shields.io/badge/docs-hexpm-blue.svg)](http://hexdocs.pm/elixir_script/) [![Build](https://travis-ci.org/elixirscript/elixirscript.svg?branch=master)](https://travis-ci.org/elixirscript/elixirscript)
The goal is to convert a subset (or full set) of Elixir code to JavaScript, providing the ability to write JavaScript in Elixir. This is done by taking the Elixir AST and converting it into JavaScript AST and then to JavaScript code. This is done using the [Elixir-ESTree](https://github.com/elixirscript/elixir-estree) library.
[Documentation for current release](http://hexdocs.pm/elixir_script/)
# Requirements
* Erlang 20 or greater
* Elixir 1.6 or greater (must be compiled with Erlang 20 or greater)
* Node 8.2.1 or greater (only for development)# Usage
Add dependency to your deps in mix.exs:
```elixir
{:elixir_script, "~> x.x"}
```Add `elixir_script` to list of mix compilers in mix.exs
Also add `elixir_script` configuration```elixir
def project do
[
app: :my_app,
# ...
# Add elixir_script as a compiler
compilers: Mix.compilers ++ [:elixir_script],
# Our elixir_script configuration
elixir_script: [
# Entry module. Can also be a list of modules
input: MyEntryModule,
# Output path. Either a path to a js file or a directory
output: "priv/elixir_script/build/elixirscript.build.js"
]
]
end
```Run `mix compile`
# Examples
### Application
[ElixirScript Todo Example](https://github.com/elixirscript/todo-elixirscript)
### Library
[ElixirScript React](https://github.com/elixirscript/elixirscript_react)
### Starter kit
[Elixirscript Starter Kit](https://github.com/harlantwood/elixirscript-starter-kit)
# Development
```bash
# Clone the repo
git clone [email protected]:bryanjos/elixirscript.git#Get dependencies
make deps# Compile
make# Test
make test
```# Communication
[#elixirscript](https://elixir-lang.slack.com/messages/elixirscript/) on the elixir-lang Slack
# Contributing
Please check the [CONTRIBUTING.md](CONTRIBUTING.md)