Utility to extract example code from Mocha test files and embed it into markdown, HTML, or other documentation formats via placeholder directives like `[require:testName]`. Version 0.1.1 is the latest stable release, last updated in 2016 with no active development. Requires peer dependency `acquit >= 0.4.0`. Differentiates from generic doc generators by providing a simple, test‑driven approach to keep documentation in sync with actual tests.
npm install acquit-requireVerified import paths — ran on the pinned version, not inferred.
Shows how to load a markdown template and test file, then use transform() to replace placeholders with matching Mocha test code.
Use unique placeholder names, e.g. [require:unique-test-title].
Write tests using `describe('...', function() { it('...', function() { ... }); });`Consider forking or using an alternative like 'code-docs-examples'. Test with your specific versions.
Run: npm install acquit-require acquit
Change to: import { transform } from 'acquit-require'Use named import: import { findTest } from 'acquit-require'