0.1.7 • Published 10 years ago

node-jsjs v0.1.7

Weekly downloads
72
License
-
Repository
github
Last release
10 years ago

Jsjs

A handy javascript dialectic transpiler

Build Status via Travis CI

Pull requests are very welcome!

Install

$ npm install [-g] jsjs

Features

  • Not many, at the moment barelly recompiles sources.

Documentation

Usage

$ jsjs [options] <file> [...<files>]

Options


Options

Indents code with number of spaces for each indentation level.


Removes optional whitespace between statements and declarations.


Use another input dialect instead of javascript.

Javascript dialects are basically different languages which follow the style and the semantics of javascript.

This library includes the following dialects:

Standard Javascript (js): Common ECMAScript 5.

function pow(a, b){
    for (var r = a, n = 0; n < b; n++) {
        r = r * a
    }
    return r
}

function head(arr){
    return arr.slice(0, 1);
}

Go-Script (gs): A clone of Go syntax without the type stuff.

func pow(a, b){
    for r := a, n := 0; n < b; n++ {
        r = r * a
    }
    return r
}

func head(arr){
    return arr[0:1]
}

To register dialects as Node's require.extensions, you can use jsjs.register:

var jsjs = require('jsjs');

jsjs.register('gs'); // Go-Script registered
var gos = require('./go-test.gs');

jsjs.register(jsjs.dialects); // registers all supported jsjs dialects
0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago