> ## Documentation Index
> Fetch the complete documentation index at: https://codspeed.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Writing Benchmarks in JavaScript and TypeScript

There are multiple ways to integrate CodSpeed with your JS/TS codebase:

<Card horizontal title="vitest (recommended)" href="/benchmarks/nodejs/vitest" icon="star">
  The most convenient way to run your Node.js benchmarks
</Card>

<Columns cols={2}>
  <Card title="tinybench" href="/benchmarks/nodejs/tinybench">
    A lightweight benchmarking library with a simple API
  </Card>

  <Card title="benchmark.js" href="/benchmarks/nodejs/benchmarkjs">
    The legacy benchmarking library for JavaScript
  </Card>
</Columns>

We recommend using the `vitest` plugin as it is the easiest to use and has the
most features.

If you are already using `benchmark.js` or `tinybench`, check out their
respective plugins as they require only a small wrapping to work with CodSpeed.

To benchmark a user flow end-to-end, use the Playwright integration:

<Card title="Playwright" href="/benchmarks/nodejs/playwright">
  Drive an app through Playwright and measure real flows.
</Card>
