Registry / testing / rest-chronicle

rest-chronicle

JSON →
library2.7.0jsnpmunverified

Auto-generate REST API documentation from test coverage, clients (Axios, Supertest), or Express middleware. Version 2.7.0, actively maintained, supports Node >=10. Differentiators: works with existing test suites (Mocha, Ava), multiple output formats (Swagger, ApiBlueprint, RAML), and minimal configuration. No automatic inference, requires manual recording via clients.

npm install rest-chronicle
INSTALL
IMPORT
SIG · REST-CHRONICLE
R
rest-chronicle
testingjavascriptv2.7.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

chronicle
import chronicle from 'rest-chronicle'
const chronicle = require('rest-chronicle')
Default export; ESM-only since v2 (no CommonJS support).
Axios
import { Axios } from 'rest-chronicle'
import { AxiosClient } from 'rest-chronicle'
Named export for the Axios recording client. Ensure axios is installed as a peer dependency.
Supertest
import { Supertest } from 'rest-chronicle'
Named export for the Supertest recording client. Requires supertest as a peer dependency.

Basic usage: create an Axios client that records all HTTP requests, then save the documentation to a JSON file.

import chronicle, { Axios } from 'rest-chronicle'; const axiosClient = new Axios(chronicle); await axiosClient({ method: 'GET', url: 'https://api.example.com/users', }); chronicle.save('./api-docs.json'); console.log('Documentation saved to api-docs.json');
Debug
Known issues
gotchachronicle is a singleton; using multiple instances may not work as expected.
fix
Use the default import and avoid creating new Chronicle instances.
affects: *
breakingIn version 2.0.0, the API changed from class-based to functional. Old code using new Chronicle() will break.
fix
Migrate to default import chronicle and use clients (Axios, Supertest) instead of Chronicle constructor.
affects: <2.0.0
deprecatedIn version 1.x, the package had a different export structure (require('rest-chronicle').Chronicle). This is removed in v2.
fix
Update imports to use ESM syntax as shown in the quickstart.
affects: 1.x
Errors
Common errors & fixes
Cannot find module 'rest-chronicle'
Package not installed or npm install failed.
fix
Run `npm install --save rest-chronicle` and ensure Node >=10.
chronicle.save is not a function
Using an outdated import pattern (e.g., require vs import).
fix
Use `import chronicle from 'rest-chronicle'` (ESM only).
Axios is not a constructor
Axios peer dependency missing or wrong import path.
fix
Install axios with `npm install axios` and import `{ Axios }` from the package.
Upgrade
Version history
2.7.0latest on npm
Audit
Dependencies
axiosoptionalUsed as a recording client to capture HTTP requests for documentation
supertestoptionalUsed as a recording client for test-driven documentation generation
Agent activity
4 hits · last 30 days
node
4
Resources
rest-chronicle — npm install rest-chronicle · libregistry