{"id":51018240,"url":"https://github.com/MarceloDelgadoDev/asp-classic-emulator","last_synced_at":"2026-07-09T14:00:35.403Z","repository":{"id":358802015,"uuid":"1239115267","full_name":"MarceloDelgadoDev/asp-classic-emulator","owner":"MarceloDelgadoDev","description":"Run ASP Classic on macOS, Linux and BSD. Drop npx asp-emulator into any project folder and get a high-fidelity VBScript HTTP server — no Windows, no IIS, no VM. Full ASP object model, SQLite/MySQL/PostgreSQL support, and a hand-written Chevrotain parser.","archived":false,"fork":false,"pushed_at":"2026-05-19T05:06:10.000Z","size":64,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-19T07:28:06.058Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarceloDelgadoDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-14T19:22:35.000Z","updated_at":"2026-05-19T05:06:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/MarceloDelgadoDev/asp-classic-emulator","commit_stats":null,"previous_names":["marcelodelgadodev/asp-classic-emulator"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/MarceloDelgadoDev/asp-classic-emulator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarceloDelgadoDev%2Fasp-classic-emulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarceloDelgadoDev%2Fasp-classic-emulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarceloDelgadoDev%2Fasp-classic-emulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarceloDelgadoDev%2Fasp-classic-emulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarceloDelgadoDev","download_url":"https://codeload.github.com/MarceloDelgadoDev/asp-classic-emulator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarceloDelgadoDev%2Fasp-classic-emulator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35301501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-09T02:00:07.329Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-21T14:00:20.991Z","updated_at":"2026-07-09T14:00:35.388Z","avatar_url":"https://github.com/MarceloDelgadoDev.png","language":"TypeScript","funding_links":[],"categories":["Dialects"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# asp-classic-emulator\n\n**Run ASP Classic on macOS, Linux and BSD.**\n\nNo Windows. No IIS. No VM.\n\n```bash\nnpx asp-classic-emulator\n```\n\n[![npm version](https://img.shields.io/npm/v/asp-classic-emulator)](https://www.npmjs.com/package/asp-classic-emulator)\n[![npm downloads](https://img.shields.io/npm/dm/asp-classic-emulator)](https://www.npmjs.com/package/asp-classic-emulator)\n[![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](https://nodejs.org)\n[![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)\n[![Status](https://img.shields.io/badge/status-alpha-orange)]()\n[![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20BSD-lightgrey)]()\n\n\u003c/div\u003e\n\n---\n\n## What is this?\n\nASP Classic never died — it just got stranded on Windows. Millions of lines of VBScript are still running in production, and maintaining them means either keeping a Windows Server around or setting up a VM every time someone needs to touch the code.\n\n**asp-classic-emulator** fixes that. Drop it into any folder with `.asp` files, run one command, and get a fully working HTTP server that interprets VBScript — on any POSIX system.\n\n```\nyour-project/\n├── index.asp\n├── login.asp\n└── includes/\n    └── conn.asp\n```\n\n```bash\ncd your-project\nnpx asp-classic-emulator\n# → Serving on http://localhost:3000\n```\n\n\u003e **Note:** This project is in active development. See the [Implemented](#implemented-v010) and [Planned](#planned) sections below for an accurate picture of what works today.\n\n---\n\n## Quick start\n\n### Requirements\n\n- Node.js ≥ 18\n- macOS, Linux, or BSD\n\n### Run without installing\n\n```bash\nnpx asp-classic-emulator\n```\n\n### Install globally\n\n```bash\nnpm install -g asp-classic-emulator\nasp-classic-emulator\n```\n\n### Install as a project dependency\n\n```bash\nnpm install asp-classic-emulator\n```\n\n```typescript\nimport { createServer } from 'asp-classic-emulator'\n\nconst server = createServer({\n  root: './www',\n  port: 3000,\n  mode: 'dev',\n})\n\nawait server.start()\n```\n\n---\n\n## Implemented (v0.1.0)\n\n### HTTP server\n\n- Serves `.asp` files through the VBScript interpreter\n- Serves static files (`.css`, `.js`, `.png`, `.jpg`, `.gif`, `.svg`, `.ico`) with correct `Content-Type`\n- Parses `QueryString` and `Form` (URL-encoded and multipart)\n- Request log: `GET /index.asp 200 11ms`\n- Dev error page — file name, line, column, source excerpt, stack trace\n- Prod error page — classic IIS-style (`Microsoft VBScript runtime error '800a000d'`)\n\n### VBScript — Phase 1\n\n| Construct | Status |\n|---|---|\n| `Dim`, `Set` | ✅ |\n| Variable assignment | ✅ |\n| `If` / `ElseIf` / `Else` / `End If` | ✅ |\n| `For` / `Next` | ✅ |\n| `For Each` / `Next` | ✅ |\n| `While` / `Wend` | ✅ |\n| `Do` / `Loop` | ✅ |\n| `Sub` / `End Sub` | ✅ |\n| `Function` / `End Function` (basic) | ✅ |\n| Fixed arrays — `Dim a(10)` | ✅ |\n| Expressions (arithmetic, logical, comparison, string `\u0026`) | ✅ |\n\n### ASP objects\n\n| Object | Implemented members |\n|---|---|\n| `Response` | `Write`, `End`, `Clear`, `ContentType`, `Charset` |\n| `Request` | `QueryString(\"key\")`, `Form(\"key\")` |\n\n### Type system\n\n- Full `Variant` type with subtypes: `Empty`, `Null`, `Boolean`, `Integer`, `Long`, `Double`, `String`, `Object`\n- Implicit coercion works as in IIS — warning printed to terminal\n- `--strict` flag turns coercions into runtime errors\n\n### `#include`\n\n- `\u003c!--#include file=\"...\" --\u003e` and `\u003c!--#include virtual=\"...\" --\u003e`\n- Circular reference detection (throws with full cycle path)\n\n### CLI flags (wired)\n\n| Flag | Default | Description |\n|---|---|---|\n| `--port` | `3000` | Port to listen on |\n| `--root` | `.` | Root folder with `.asp` files |\n| `--mode` | `dev` | `dev` or `prod` |\n| `--strict` | `false` | Throw on implicit type coercions |\n| `--log-level` | `info` | `silent` \\| `error` \\| `warn` \\| `info` \\| `debug` |\n| `--config` | `asp-classic-emulator.config.json` | Path to config file |\n\n### Config file\n\nCreate `asp-classic-emulator.config.json` in your project root. CLI flags override config values.\n\n```json\n{\n  \"port\": 3000,\n  \"root\": \"./www\",\n  \"mode\": \"dev\",\n  \"strict\": false,\n  \"logLevel\": \"info\"\n}\n```\n\n---\n\n## Planned\n\nThe following features are on the roadmap but **not yet implemented**.\n\n### VBScript — Phase 1 (remaining)\n\n| Construct | Status |\n|---|---|\n| `ReDim` / dynamic arrays | 🔜 |\n| `Exit For`, `Exit Do`, `Exit Sub`, `Exit Function` | 🔜 |\n| `Function` return value | 🔜 |\n\n### VBScript — Phase 2\n\n| Construct | Status |\n|---|---|\n| `Select Case` | 🔜 |\n| `On Error Resume Next` / `Err` object | 🔜 |\n| `With` / `End With` | 🔜 |\n| `Class` / `End Class` | 🔜 |\n| `Execute` / `ExecuteGlobal` | 🔜 |\n| Full VBScript built-in functions (`Split`, `Replace`, `Mid`, `DateAdd`, ...) | 🔜 |\n\n### ASP objects (remaining)\n\n| Object / member | Status |\n|---|---|\n| `Response.Redirect`, `Response.Cookies`, `Response.Headers` | 🔜 |\n| `Request.Cookies`, `Request.ServerVariables`, `Request.BinaryRead` | 🔜 |\n| `Session` (Contents, Abandon, Timeout, SessionID) | 🔜 |\n| `Application` (Contents, Lock, Unlock) | 🔜 |\n| `Server` (CreateObject, MapPath, URLEncode, HTMLEncode) | 🔜 |\n\n### Database support\n\n| Feature | Status |\n|---|---|\n| `ADODB.Connection` + `ADODB.Recordset` | 🔜 |\n| SQLite (built-in, zero config) | 🔜 |\n| MySQL / MariaDB | 🔜 |\n| PostgreSQL | 🔜 |\n\n### Other\n\n| Feature | Status |\n|---|---|\n| `global.asa` (`Application_OnStart`, `Session_OnStart`) | 🔜 |\n| `.html` / `.htm` with embedded ASP blocks | 🔜 |\n| `#include` cache (invalidated on file change) | 🔜 |\n| Watch mode (auto-reload on file change) | 🔜 |\n| `--watch` / `--timeout` wired to runtime | 🔜 |\n| `--help` flag | 🔜 |\n| Config keys: `session`, `databases`, `virtualDirectories` | 🔜 |\n\n---\n\n## Type system\n\nVBScript's `Variant` type is fully emulated. Every variable can hold any subtype and changes at runtime — just like the original.\n\n```vbscript\nDim x\nx = 42      ' Long\nx = \"hello\" ' String\nx = True    ' Boolean\nx = Null    ' Null (contagious in expressions)\nx = Empty   ' Empty (zero in numeric context)\n```\n\n### Implicit coercion\n\nBy default, implicit coercions work exactly as in IIS, and a warning is printed to the terminal:\n\n```\n[WARN] Implicit coercion in /dashboard.asp:12 — String \"42\" → Number\n       Use CInt() or CDbl() for explicit conversion. Run with --strict to throw instead.\n```\n\nUse `--strict` to turn all implicit coercions into runtime errors:\n\n```bash\nasp-classic-emulator --strict\n```\n\n---\n\n## Architecture\n\n```\nHTTP Request\n     │\n     ▼\nHTTP Server (node:http)\n     │\n     ▼\nRequest Parser  ──  QueryString, Form, Headers\n     │\n     ▼\nASP Pre-processor  ──  resolve #include, split HTML / \u003c% %\u003e\n     │\n     ▼\nLexer (Chevrotain)  ──  text → typed token stream\n     │\n     ▼\nParser (Chevrotain)  ──  tokens → AST with line/column info\n     │\n     ▼\nInterpreter  ──  walks AST, injects ASP objects, executes VBScript\n     │\n     ▼\nHTTP Response  ──  flush HTML buffer to client\n```\n\n---\n\n## Why a hand-written parser?\n\nNo usable VBScript parser exists in the Node.js ecosystem. The few packages that exist are abandoned, incomplete, or cover less than 60% of the grammar.\n\n[Chevrotain](https://chevrotain.io) was chosen because:\n\n- **TypeScript native** — no separate grammar file, no code generation step\n- **Incrementally extensible** — adding `Select Case` or `With` is a new method, nothing existing breaks\n- **Built-in error recovery** — precise line and column in every error message\n- **Production-grade** — used by SAP, MongoDB, and others\n\n---\n\n## Contributing\n\nContributions are welcome, especially:\n\n- VBScript built-in functions (`Split`, `Join`, `Replace`, `Mid`, `DateAdd`, etc.)\n- `ReDim`, `Exit`, and `Function` return value (Phase 1 remaining items)\n- Additional `Response` and `Request` members\n- Real-world ASP fixture files for the test suite (anonymized is fine)\n- Bug reports with `.asp` snippets that don't behave as expected\n\n```bash\ngit clone https://github.com/MarceloDelgadoDev/asp-classic-emulator\ncd asp-classic-emulator\nnpm install\nnpm run dev\nnpm test\n```\n\n---\n\n## License\n\nMIT — see [LICENSE](LICENSE) for details.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003csub\u003eBuilt for the developers keeping legacy systems alive.\u003c/sub\u003e\n\u003c/div\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarceloDelgadoDev%2Fasp-classic-emulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMarceloDelgadoDev%2Fasp-classic-emulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarceloDelgadoDev%2Fasp-classic-emulator/lists"}