This guide is for developers who want to build, test, or contribute to the MeridianAlgo source code.
- Node.js: Version 18.0.0 or higher.
- npm or pnpm (preferred).
Clone the repository and install dependencies:
git clone https://github.com/MeridianAlgo/Javascript-Packages.git
cd Javascript-Packages
pnpm installMeridianAlgo is written in TypeScript. To compile the project to JavaScript:
pnpm run buildThis will:
- Clear the
distdirectory. - Compile TypeScript files using
tsc. - Resolve path aliases using
tsc-alias.
We use Jest for all unit and integration tests.
# Run all tests
pnpm test
# Run tests in watch mode
pnpm run test:watch
# Generate coverage report
pnpm run test:coverageTo ensure code quality and consistency:
# Run ESLint
pnpm run lint
# Automatically fix linting issues
pnpm run lint:fixThere are several built-in examples in the examples/ directory to demonstrate functionality:
# Basic backtest demo
pnpm run example:basic
# Advanced features (ML, etc.)
pnpm run example:advanced
# Risk management demo
pnpm run example:risksrc/: Core library source code.dist/: Compiled JavaScript output.examples/: Reference implementations for users.docs/: Markdown-based documentation.