# electron-docs

> Fetch Electron documentation as raw markdown strings

Latest version **3.0.2** (published 2017-05-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install electron-docs
pnpm add electron-docs
yarn add electron-docs
bun add electron-docs
```

Provides the command `electron-docs`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.2 |
| Published | 2017-05-23 |
| First published | 2016-06-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Zeke Sikelianos |
| Maintainers | zeke |
| Keywords | electron, api, documentation, markdown, reference, schema, raw |

## Links

- npm: https://www.npmjs.com/package/electron-docs
- Repository: https://github.com/electron/electron-docs
- Homepage: https://github.com/electron/electron-docs#readme
- Issues: https://github.com/electron/electron-docs/issues
- npm.io page: https://npm.io/package/electron-docs

## Dependencies (8)

- [got](https://npm.io/package/got.md) ^6.3.0
- [ora](https://npm.io/package/ora.md) ^0.2.3
- [pify](https://npm.io/package/pify.md) ^2.3.0
- [semver](https://npm.io/package/semver.md) ^5.1.0
- [tar-fs](https://npm.io/package/tar-fs.md) ^1.13.0
- [node-dir](https://npm.io/package/node-dir.md) ^0.1.12
- [path-exists](https://npm.io/package/path-exists.md) ^3.0.0
- [gunzip-maybe](https://npm.io/package/gunzip-maybe.md) ^1.3.1

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 3.0.2 (latest) — 2017-05-23
- 3.0.1 — 2017-05-13
- 3.0.0 — 2016-12-16
- 2.0.1 — 2016-11-12
- 2.0.0 — 2016-11-10
- 1.2.3 — 2016-10-05
- 1.2.2 — 2016-09-09
- 1.2.1 — 2016-09-09
- 1.2.0 — 2016-06-29
- 1.1.0 — 2016-06-24
- 1.0.5 — 2016-06-17
- 1.0.4 — 2016-06-17
- 1.0.3 — 2016-06-17
- 1.0.2 — 2016-06-17
- 1.0.1 — 2016-06-17
- … 1 more at https://npm.io/package/electron-docs/versions

## README

# electron-docs [![Build Status](https://travis-ci.org/electron/electron-docs.svg?branch=master)](https://travis-ci.org/electron/electron-docs)

This package consumes the [electron/electron](https://github.com/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](https://github.com/electron/electron-docs-linter).

## Installation

```sh
npm install electron-docs --save
```

## Programmatic Usage

Require the function and call it with any of the following:

- A remote branch name, like `master`
- A version number, like `1.4.4`
- A version number that starts with a `v`, like `v1.7.0`
- A commit SHA, like `76375a83eb3a97e7aed14d37d8bdc858c765e564`
- A local directory, like `~/my/path/to/electron/`

```js
const electronDocs = require('electron-docs')

electronDocs('master').then(function(docs) {
  // docs is an array of objects, one for each markdown file in /docs
})
```

Each object in the `docs` array looks like this:

```js
{
 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:

```js
const path = require('path')
const docsPath = path.join(__dirname, 'docs')
electronDocs(docsPath).then(function(docs) {
  // ...
})
```

If you prefer node-style callbacks instead of promises, those are supported too:

```js
electronDocs('1.0.0', function(err, docs) {
  console.log(err, docs)
})
```

## CLI Usage

Add this to your package.json file:

```json
{
  "scripts": {
    "docs": "electron-docs > docs.json"
  }
}
```

When you run `npm run docs`, the module writes the stringified JSON object to
`stdout`, and the output is piped into a file.

`stdout` ftw!

## Tests

```sh
npm i && npm t
```

## Dependencies

- [got](https://ghub.io/got): Simplified HTTP requests
- [gunzip-maybe](https://github.com/mafintosh/gunzip-maybe): Transform stream that gunzips its input if it is gzipped and just echoes it if not
- [node-dir](https://ghub.io/node-dir): asynchronous file and directory operations for Node.js
- [ora](https://ghub.io/ora): Elegant terminal spinner
- [path-exists](https://ghub.io/path-exists): Check if a path exists
- [pify](https://github.com/sindresorhus/pify): Promisify a callback-style function
- [semver](https://ghub.io/semver): The semantic version parser used by npm.
- [tar-fs](https://github.com/mafintosh/tar-fs): filesystem bindings for tar-stream

## Dev Dependencies

- [tap-spec](https://github.com/scottcorgan/tap-spec): Formatted TAP output like Mocha&#39;s spec reporter
- [tape](https://github.com/substack/tape): tap-producing test harness for node and browsers

## License

MIT

---
_Source: https://npm.io/package/electron-docs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
