Transpile HaLang to Javascript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
examples
src
test
.babelrc
.editorconfig
.gitignore
.travis.yml
CONTRIBUTING.md
LICENCE
README.md
package-lock.json
package.json

README.md

hatp

Build Status npm Version

The transpiler which transpile HaLang to Javascript, based on Acorn and Astring.

Usage

This package exports a convert function as default.

import convert from 'hatp';
const config = {
  ha: {}, // Config for ha the acorn plugin. If none, use `true`.
  acorn: { sourceType: 'module' }, // Config for acorn.
  astring: {}, // Config for astring.
};
convert(`钦定 蛤 = “主席”;`, config);

You can also use this package in CLI:

$ hatp -o built/
测试.ha -> built/测试.js

See more CLI usage by hatp -h.

License

MIT.