china-liji / Rexjs
Licence: mit
Rexjs is a faster and smaller JavaScript(ES6+) compiler!
Stars: ✭ 15
Programming Languages
Labels
Projects that are alternatives of or similar to Rexjs
Viper
[WIP] A Pythonesque language with a design that focuses on efficiency and expressiveness. Compiles to WebAssembly
Stars: ✭ 23 (+53.33%)
Mutual labels: compiler
Rustc Dev Guide
A guide to how rustc works and how to contribute to it.
Stars: ✭ 789 (+5160%)
Mutual labels: compiler
Diez
The Design Token Framework — Adopt a unified design language across platforms, codebases, and teams
Stars: ✭ 928 (+6086.67%)
Mutual labels: compiler
Hamler
Haskell-style functional programming language running on Erlang VM.
Stars: ✭ 840 (+5500%)
Mutual labels: compiler
Grin
GRIN is a compiler back-end for lazy and strict functional languages with whole program optimization support.
Stars: ✭ 834 (+5460%)
Mutual labels: compiler
Dugong
Minimal State Store Manager for React Apps using RxJS
Stars: ✭ 10 (-33.33%)
Mutual labels: compiler
Tvm
Open deep learning compiler stack for cpu, gpu and specialized accelerators
Stars: ✭ 7,494 (+49860%)
Mutual labels: compiler
Ferret
Ferret is a free software lisp implementation for real time embedded control systems.
Stars: ✭ 878 (+5753.33%)
Mutual labels: compiler
Cfl
a Compileable statically typed Functional programming Language
Stars: ✭ 7 (-53.33%)
Mutual labels: compiler
JavaScript(ES6+)
compiler!
Rexjs is a faster and smaller 中文
Link
Install
- NPM
npm install rexjs-api
- Git
git clone https://github.com/china-liji/Rexjs.git
- Download
rex.min.js - 250KB
rex-api.min.js - 247KB
rex-browser-helper.min.js - 18KB
Faster and Smaller
./dist/rex.min.js
[1.7.1] only 250KB, smaller than others.
Usage
Web
<script src="./dist/rex.min.js"></script>
<!-- set the "type" attribute to define a module -->
<script type="text/rexjs">
import "./module.js";
export default class {};
</script>
<!--
also, set the "src" attribute to reference a module,
and add the "data-sourcemaps" attribute to enable sourcemaps.
-->
<script src="./module.js" type="text/rexjs" data-sourcemaps></script>
cross browser: Chrome
、Firefox
、Safari
、IE9+
.
Nodejs
- ./ext.js
import path from "path";
export default function(filename){
return path.parse(filename).ext;
};
- ./index.js
import ext from "./ext.js";
// output ".js"
ext(__filename);
- Command Line
rexjs ./index.js
Rexjs API
- JavaScript
// import "rexjs-api" module
// Nodejs
let Rexjs = require("rexjs-api");
// Web Worker
importScripts("./dist/rex-api.min.js");
let Rexjs = self.Rexjs;
// Web: <script src="./dist/rex.min.js"></script>
let Rexjs = window.Rexjs;
// initialize parser
let es5Code = "", parser = new Rexjs.ECMAScriptParser();
// parse module from a file
parser.parse(
// init file
new Rexjs.File(
// filename
"./filename.js",
// source
"class Car {}"
)
);
// returning the generated code
es5Code = parser.build();
- HTML
This file provides generated code API, so reference it before run generated code in your browser.
<script src="./dist/rex-browser-helper.min.js"></script>
Other Packages
-
Rexjs-loader - Webpack Loader.
-
Rexjs-template - A data binding HTML template compiler.
Thanks!
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].