Quick start — scaffold a new project
npm install -g @configuredthings/rdp.js
mkdir my-parser && cd my-parser
rdp-gen init --name my-parser
npm install
npm run build # compiles src/MyParser.ts → dist/rdp-gen init writes a package.json, a tsconfig.json with all required
compiler options pre-configured, and a starter src/MyParser.ts containing the
private-constructor / static-parse boilerplate — so the project compiles
immediately and you can start filling in grammar rules.
Add --observable to extend ObservableRDParser instead, with notifyEnter/notifyExit
call sites pre-wired and an optional ParseObserver parameter in static parse().
Setup without scaffolding
Install: npm install @configuredthings/rdp.js
Required tsconfig.json options:
{
"compilerOptions": {
"target": "ES2022",
"strict": true,
"noUncheckedIndexedAccess": true,
"moduleResolution": "node16"
}
}target: ES2022— required for native#private fieldsstrict: true— generated code is written to strict standardsnoUncheckedIndexedAccess: true— all array accesses are null-awaremoduleResolution: node16orbundler— required for the package exports map