JSPM

hogget

0.1.0-dev
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q20908F
  • License ISC

Compiler, linter and formatter for the Hogget programming language

Package Exports

  • hogget

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hogget) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Hogget compiler

Installation

Requires Node.js v10 or higher. This package has no dependencies.

npm install hogget --global

Compiling

The Hogget compiler needs an input and output to run. To run from the terminal:

hogget --input program.hgg --output program.hgg.js

or, more concisely:

hogget -i program.hgg -o program.hgg.js

To run programatically from Node.js:

import hogget from 'hogget'
const hoggetString = 'log("the answer is" add(12 30))'
console.log(hogget(hoggetString))

The hogget package also exports a parse method.

Linting

To run from the terminal, either the --lint or -l option must be used:

hogget --lint --input program.hgg

To run programatically from Node.js:

import { lint } from 'hogget'
const hoggetString =
  'let myAdd = (a, b) => { let result = add(a, b); result; };'
console.log(lint(hoggetString))

Formatting

To run from the terminal, either the --format or -f option must be used:

hogget --format --input program.hgg