@candlelib/js
TypeScript icon, indicating that this package has built-in type declarations

0.5.29 • Public • Published

CandleLibrary JS

JavaScript Parsing & AST Library

npm (tag)

CandleLibrary JS is both a standalone JavaScript parser written in TypeScript, and a critical part of the CandleLibrary component system. It can be used independently within projects that require the capability to parse and generate a simple AST for JavaScript string inputs.

CL JS AST's can be traversed using cfw.Conflagrate traversal functions, and rendered to string with customized formatting using Conflagrate's rendering functions. These functions are integrated within the library.

Note: CandleLibrary JS only evaluates syntactic forms within a JavaScript string input. It is not designed to evaluate semantics and cannot be used as-is to determine whether an input is semantically correct.


This library builds upon and extends the functionality found withing the following CFW libraries:

  • cfw.Wind
  • cfw.Hydrocarbon
  • cfw.Conflagrate

Installation

Yarn

yarn add @candlelib/js

NPM

npm install --save @candlelib/js

Usage

nodejs

import { parse as jsParse, render as jsRender } from "@candlelib/js";

const js_ast = jsRender(` console.log("Hello World") `);

const rendered_string = jsRender(ts_ast); 

// "console.log("Hello World")"

Documentation

TODO

License

MIT License - Copyright 2020 Anthony C. Weathersby

see full license

Package Sidebar

Install

npm i @candlelib/js

Weekly Downloads

1

Version

0.5.29

License

MIT

Unpacked Size

591 kB

Total Files

60

Last publish

Collaborators

  • galactrax