Registry / serialization / dawn.js

dawn.js

JSON →
library0.1.1jsnpmunverified

dawn.js is a general-purpose source-to-source transpiler framework implemented in JavaScript (CoffeeScript). Version 0.1.1 provides built-in lexical parser, syntax parser (with AST generation), symbol table generator, and a customizable plugin system (Flow) for transforming code between languages. It targets developers needing autocompletion, refactoring, or cross-language compilation features. Released under MIT, but appears to be early-stage with limited documentation and infrequent updates compared to established alternatives like Babel or Recast.

npm install dawn.js
INSTALL
IMPORT
SIG · DAWN.JS
D
dawn.js
serializationjavascriptv0.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LexParser
✓ import { LexParser } from 'dawn.js'
✗ const dawn = require('dawn.js'); new dawn.LexParser()
Package uses ES6 modules; ensure bundler configured for ESM.
SyntaxParser
✓ import { SyntaxParser } from 'dawn.js'
✗ import SyntaxParser from 'dawn.js'
SyntaxParser is a named export, not default.
Flow
✓ import { Flow } from 'dawn.js'
✗ const Flow = require('dawn.js').Flow
Flow is the plugin system; available as named export.

Demonstrates basic lexical and syntax parsing, and symbol table generation using dawn.js.

import { LexParser, SyntaxParser, SymbolTable, Flow } from 'dawn.js'; const code = `const x = 1 + 2;`; // Lexical analysis const lexer = new LexParser(); const tokens = lexer.analyze(code); console.log('Tokens:', tokens); // Syntax analysis (requires BNF grammar definition) // Minimal example using built-in grammar? Not explicitly provided. // Assume BNF grammar string: const bnf = ` <program> ::= <statement> <statement> ::= <assignment> <assignment> ::= "const" <identifier> "=" <expression> ";" <expression> ::= <number> "+" <number> `; const syntaxParser = new SyntaxParser(bnf); const ast = syntaxParser.parse(tokens); console.log('AST:', ast); // Symbol table const symbolTable = new SymbolTable(); symbolTable.build(ast); console.log('Symbols:', symbolTable); // Plugin system placeholder const flow = new Flow(); // flow.addPlugin(...);
Debug
Known issues
deprecatedPackage appears abandoned; last update was years ago.
fix
Consider alternatives like Babel, Recast, or SWC for active transpilation needs.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'dawn.js'
Package not installed or wrong import path.
fix
npm install dawn.js (note: npm package name is dawn.js with dot)
TypeError: dawn.LexParser is not a constructor
Incorrect import style (CommonJS vs ESM).
fix
Use import { LexParser } from 'dawn.js' instead of require.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
3 hits · last 30 days
node
2
Resources
dawn.js — npm install dawn.js · libregistry