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

harmonika

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

harmonika

harmonika parse your ES5 code to ES6. Based on existing project with the same purpose xto6 with additional on-going features.

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Harmonika

Harmonika

Harmonika parse your Closure code to ES6. Extended from existing project xto6, with additional on-going features to support Closure.

Install

$ npm install harmonika

Run Example

$ harmonika  -s input_files/ins/sample0.js

Developing

Clone from github

$ npm install
$ grunt
$ node bin/index.js --help

Directory Structure

* bin /
  | - index.js (main entry)
* input_files /(sample)
* src /
  | - syntax /
      | - AST representation (reference Mozilla Parser AST)
  | - transformation / (list of parser function)
  | - utils / (string->ast && ast -> string library)
* test /

Previous project existing features

  • Function/Prototypes to Classes
  • Callback to Arrow functions
  • String concatenation to Template Strings
  • Using let and const instead of var
  • Default arguments instead of a = a || 2
  • Function properties in objects to Object methods

Added features

  • Remove Namespace
  • Convert Google Closure code (goog.require, goog.provide, goog.inherits, goog.isDefinedAndNotNull) to compatible ES6 features
  • Convert Closure annotation to Flow type (Currently support : @param, @type, @typedef, @return) and Import/Export type
  • Detect Inheritance (super call, extend)
  • Improve constructor to support arguments
  • import support
  • export support
  • Implicit import (import all undefined identifier)
  • static method
  • static properties
  • Base class method call using super
  • Improve let/const to understand object assignment
  • Singleton export

To-do Features

Keywords

FAQs

Package last updated on 27 Aug 2015

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