UNPKG

openapi-client-axios

Version:

JavaScript client library for consuming OpenAPI-enabled APIs with axios. Types included.

27 lines (23 loc) 566 B
#!/usr/bin/env node const fs = require('fs'); const path = require('path'); const Toc = require('markdown-toc'); function main() { const filename = path.join(__dirname, '..', 'DOCS.md'); const docs = fs.readFileSync(filename, 'utf8'); const opts = { maxdepth: 3, bullets: '-', slugify: (text) => text .toLowerCase() .replace(/\s/g, '-') .replace(/[^\w-]/g, ''), }; const output = Toc.insert(docs, opts); fs.writeFileSync(filename, output); console.log('Done!'); } if (require.main === module) { main(); }