Yakbak is a Node.js library for recording and playing back HTTP interactions, serving as a "VCR" for your HTTP clients during testing and development. It operates as a reverse proxy: requests are forwarded to a target host, and their responses are recorded ("taped") to disk. Subsequent identical requests are then played back from these recorded tapes instead of hitting the remote server, enabling consistent and fast test runs. Tapes are stored as `.js` files (Node modules), allowing for standalone replay servers. The current stable version is 5.0.1. While there isn't a strict release cadence, updates appear to be driven by dependency maintenance and Node.js version compatibility. Key differentiators include its reverse proxy approach, the flexible storage of tapes as re-executable Node modules, and its seamless integration with Node's native `http` module or popular frameworks like Express.
npm install yakbakVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates setting up a Yakbak proxy server using Node's `http` module. It configures Yakbak to record or playback requests to `https://httpbin.org` and then makes a client request through the proxy to show the interaction, cleaning up the generated tapes afterwards.
Upgrade your Node.js environment to version 10 or higher to ensure compatibility.
Always specify a valid, writable directory path for `dirname` in the options object, e.g., `{ dirname: path.join(__dirname, 'tapes') }`.Be aware of the `noRecord` option's behavior. If you want requests to be recorded when no tape exists, ensure `noRecord` is `false` or omitted (as it defaults to `false`).
Provide the path to a recorded tape file that you wish to serve, for example: `yakbak ./tapes/your-tape-id.js`.
No dependency data recorded yet.