This is an exercise to study and practice:
- TypeScript
- Sorting algorithms
- Unit testing
- Profiling
- Documenting
- Version control
- Continuous integration
Implement, unit test, document, time profile, and memory profile different sorting algorithms.
Keep things simple!
- Don't use dependencies unless absolutely necessary.
- Create your own micro-frameworks for unit testing and profiling, if possible.
curl -fsSL https://bun.sh/install | bash # Bun
curl -fsSL https://deno.land/x/install/install.sh | sh # Deno
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash # NVM
You can use the provided scripts to run everything easily. One of the secondary goals of the exercise is to informally benchmark the runtime and memory usage of different runtimes, including:
- Node
- Bun
- TS-Node
- TSC + Node
The scripts
directory is where this dynamic is centralized.
For Unix, Linux, and MacOS, you can use the shell executable files.
./scripts/unit-tests-bun.sh # Run all unit tests with Bun
./scripts/unit-tests-ts-node.sh # Run all unit tests with TS-Node
./scripts/unit-tests-ts-tsc.sh # Transpile with TSC and run all unit tests with Node
Pull requests and code reviews are always welcome!