This document describes how to use the package manager (npm) for development tasks.
Install development dependencies:
npm install
Check code for potential issues:
npm run lint
Automatically fix linting issues where possible:
npm run lint:fix
Check code formatting (JavaScript files only):
npm run format:check
Format JavaScript files:
npm run format
Note: The existing codebase uses its original formatting style. Prettier and ESLint are provided as optional tools for new code or improvements.
Run all checks (formatting and linting):
npm run validate
Currently, there are no automated tests configured:
npm run test
Build Docker images:
npm run docker:build # Standard Debian-based image
npm run docker:build-alpine # Alpine-based image
The package manager setup includes:
These tools are configured but non-intrusive to the existing codebase.
.
├── speedtest.js # Main speedtest library
├── speedtest_worker.js # Web Worker for speed testing
├── index.html # Default UI
├── backend/ # PHP backend files
├── examples/ # Example implementations
├── results/ # Results/telemetry handling
├── docker/ # Docker-related files
└── package.json # npm package configuration
The package manager provides several benefits:
When making changes:
npm run lint to check for potential issuesnpm run format on new files for consistency