{"id":25159,"library":"dawn.js","title":"dawn.js","description":"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.","status":"abandoned","version":"0.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/qdwang/dawn.js","tags":["javascript","dawn.js","AST","compiler","transpiler","lex parser","syntax parser","symbol talbe","BNF parser"],"install":[{"cmd":"npm install dawn.js","lang":"bash","label":"npm"},{"cmd":"yarn add dawn.js","lang":"bash","label":"yarn"},{"cmd":"pnpm add dawn.js","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package uses ES6 modules; ensure bundler configured for ESM.","wrong":"const dawn = require('dawn.js'); new dawn.LexParser()","symbol":"LexParser","correct":"import { LexParser } from 'dawn.js'"},{"note":"SyntaxParser is a named export, not default.","wrong":"import SyntaxParser from 'dawn.js'","symbol":"SyntaxParser","correct":"import { SyntaxParser } from 'dawn.js'"},{"note":"Flow is the plugin system; available as named export.","wrong":"const Flow = require('dawn.js').Flow","symbol":"Flow","correct":"import { Flow } from 'dawn.js'"}],"quickstart":{"code":"import { LexParser, SyntaxParser, SymbolTable, Flow } from 'dawn.js';\n\nconst code = `const x = 1 + 2;`;\n\n// Lexical analysis\nconst lexer = new LexParser();\nconst tokens = lexer.analyze(code);\nconsole.log('Tokens:', tokens);\n\n// Syntax analysis (requires BNF grammar definition)\n// Minimal example using built-in grammar? Not explicitly provided.\n// Assume BNF grammar string:\nconst bnf = `\n<program> ::= <statement>\n<statement> ::= <assignment>\n<assignment> ::= \"const\" <identifier> \"=\" <expression> \";\"\n<expression> ::= <number> \"+\" <number>\n`;\nconst syntaxParser = new SyntaxParser(bnf);\nconst ast = syntaxParser.parse(tokens);\nconsole.log('AST:', ast);\n\n// Symbol table\nconst symbolTable = new SymbolTable();\nsymbolTable.build(ast);\nconsole.log('Symbols:', symbolTable);\n\n// Plugin system placeholder\nconst flow = new Flow();\n// flow.addPlugin(...);\n","lang":"javascript","description":"Demonstrates basic lexical and syntax parsing, and symbol table generation using dawn.js."},"warnings":[{"fix":"Consider alternatives like Babel, Recast, or SWC for active transpilation needs.","message":"Package appears abandoned; last update was years ago.","severity":"deprecated","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install dawn.js (note: npm package name is dawn.js with dot)","cause":"Package not installed or wrong import path.","error":"Error: Cannot find module 'dawn.js'"},{"fix":"Use import { LexParser } from 'dawn.js' instead of require.","cause":"Incorrect import style (CommonJS vs ESM).","error":"TypeError: dawn.LexParser is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}