Node.js documentation parser
$ npm install node.js-docs
const docs = require("nodejs-docs");
docs.find("buffer", "v12.x")
.then(data => {
console.log(data.content)
})
.catch(console.error);This method fetches & stores data in memory. This method is used by find().
This method doesn't parse markdown content. If you want markdown contents, you have to use find() method.
- version: You can pass
node.jsversion here. For example,v12.xwill parse docs for v12. - fetchOptions: You can supply fetch options here. Options type should be
object. Example:{ force: false, all: false }. Ifforceis set totrue, it will forcefully parse docs again. Ifallis set totrue, it will return whole cache instead of the given version.
This method parses actual data from the documentation. It returns a string of markdown which can be converted to html using packages like Showdown.
- contentQuery: You can supply content qyery, generally
node.js's global/default module name. - version: You can pass
node.jsversion here.