Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-jsjs

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-jsjs

Javascript dialectic transpiler

  • 0.1.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
33
decreased by-28.26%
Maintainers
1
Weekly downloads
 
Created
Source

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

### jsjs --tab [number of spaces] | -t [number of spaces]

Indents code with number of spaces for each indentation level.


### jsjs --compress | -c

Removes optional whitespace between statements and declarations.


### jsjs --dialect [dialect] | -d [dialect]

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

Keywords

FAQs

Package last updated on 05 Sep 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc