auxsrv is a lightweight static file server and bundler designed primarily for local development, demo applications, and automated testing environments. It offers both a command-line interface (CLI) and a programmatic API. Currently at version 0.3.17, it's in a pre-1.0 state, meaning API changes may occur more frequently without strict adherence to semantic versioning. Key features include a built-in bundler for TypeScript/JavaScript, CSS, and HTML assets, a SPA (Single Page Application) mode for simplified routing, and integration capabilities for testing frameworks like Playwright. It differentiates itself by providing a minimal setup for serving and bundling, making it suitable for quick prototypes or test suites where a full-fledged build system might be overkill.
npm install auxsrvVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to programmatically start an auxsrv instance, serving files from a 'playground' directory, with bundling and SPA mode enabled.
Always pin to specific patch versions (e.g., `^0.3.17` instead of `^0.3.0`) or review changelogs thoroughly before updating to a new minor version.
To disable SPA mode, use `--spa=off` in the CLI or set `spa: false` in the programmatic `serve` options.
To disable bundling, set `bundle: false` in the programmatic options or omit the `--bundle` flag in the CLI if it's implicitly triggered. You can also specify a custom input/output for bundling.
Use `path: path.resolve(path.dirname(fileURLToPath(import.meta.url)), 'your_app_dir')` to correctly specify the base directory relative to your script. Alternatively, provide a simple string path relative to `process.cwd()`.
Change the port using the `--url <host>:<port>` flag in the CLI (e.g., `--url 3001`) or the `port` option in the programmatic `serve` call (e.g., `{ port: 3001 }`). You can also find and terminate the process currently using the port.Verify that the specified path or app directory exists and contains the files you expect to serve. Ensure the path is correct relative to where you run the command or script.
Ensure your project is configured for ESM by adding `"type": "module"` to your `package.json`, or rename your file to `.mjs`. If using TypeScript, ensure your `tsconfig.json` `module` option is set to `ESNext` or `NodeNext`.
No dependency data recorded yet.