This package consumes the electron/electron repo in search of markdown files, and returns an array of file objects with stringified file contents.
It is used by Electron's docs linter.
npm install electron-docs --save
Require the function and call it with any of the following:
- A remote branch name, like
- A version number, like
- A version number that starts with a
- A commit SHA, like
- A local directory, like
const electronDocs =
Each object in the
docs array looks like this:
slug: "windows-store-guide"filename: "docs/tutorial/windows-store-guide.md"markdown_content: "# Windows Store Guide\n\n..."
When fetching docs from a local directory, be sure to use a full path:
const path =const docsPath = path
If you prefer node-style callbacks instead of promises, those are supported too:
Add this to your package.json file:
When you run
npm run docs, the module writes the stringified JSON object to
stdout, and the output is piped into a file.
npm i && npm t
- got: Simplified HTTP requests
- gunzip-maybe: Transform stream that gunzips its input if it is gzipped and just echoes it if not
- node-dir: asynchronous file and directory operations for Node.js
- ora: Elegant terminal spinner
- path-exists: Check if a path exists
- pify: Promisify a callback-style function
- semver: The semantic version parser used by npm.
- tar-fs: filesystem bindings for tar-stream
- tap-spec: Formatted TAP output like Mocha's spec reporter
- tape: tap-producing test harness for node and browsers