https://github.com/electron/electron-api-docs
:memo: Electron's API documentation in a structured JSON format [ARCHIVED]
https://github.com/electron/electron-api-docs
Last synced: 5 months ago
JSON representation
:memo: Electron's API documentation in a structured JSON format [ARCHIVED]
- Host: GitHub
- URL: https://github.com/electron/electron-api-docs
- Owner: electron
- Archived: true
- Created: 2016-09-22T23:02:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-03T21:10:37.000Z (about 7 years ago)
- Last Synced: 2024-04-14T03:56:18.501Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 217 KB
- Stars: 9
- Watchers: 11
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# :construction: THIS PROJECT IS NO LONGER MAINTAINED. To get the latest version of Electron's structured docs, see the `electron-api.json` artifact in any Electron releaase: https://github.com/electron/electron/releases
# electron-api-docs [](https://travis-ci.org/electron/electron-api-docs)
Electron's API documentation in a structured JSON format.
## Installation
```sh
npm install electron-api-docs --save
```Or take it for a spin in your Node.js REPL:
```sh
npm i -g trymodule && trymodule electron-api-docs=apis
```Note: This package is not semantically versioned. It is published in step with
Electron. When you install `[email protected]`, you're getting the API
docs from Electron v1.4.1.## Usage
This module exports structured API data in a few different formats. Choose
the one that works best for your use case:### Object Tree Structure
To access the docs as a big object tree:
```js
const apis = require('electron-api-docs/tree')
```This gives you an object with keys for easy traversal:
```js
apis.BrowserWindow.instanceMethods.setAspectRatio
```### Array Structure
To access the docs as an array of API objects:
```js
const apis = require('electron-api-docs/electron-api.json')
```This gives you an array of API objects, so functional methods like `find`,
`map`, `filter`, and `every` can be used:```js
apis.find(api => api.name === 'BrowserWindow')
apis.filter(api => api.type === 'Class')
apis.filter(api => api.type === 'Module')
apis.map(api => api.name)
```### Keyed Array Structure
For the best of both worlds (arrays and objects), you can require the module
as a [keyed array](https://github.com/zeke/keyed-array):```js
const apis = require('electron-api-docs')
```When you require it, you get an array of API objects
```js
apis.length
// => 33
```The array has a key for each API `name`, for convenient access:
```js
apis.BrowserWindow
apis.BrowserWindow.staticMethods.getAllWindows.description
apis.WebContents.instanceMethods.savePage.parameters.saveType.possibleValues
apis.app.events.quit
```All of the arrays have named keys, but they're still actually arrays, so
functional methods like `find`, `map`, `filter`, and `every` can be used:```js
apis.find(api => api.name === 'BrowserWindow')
apis.filter(api => api.type === 'Class')
apis.filter(api => api.type === 'Module')
apis.map(api => api.name)// All arrays have named keys, not just the top-level array!
apis.BrowserWindow.instanceMethods.map(method => method.name)
```## Tests
```sh
npm install
npm test
```## Dependencies
- [keyed-array](https://github.com/zeke/keyed-array): Recursively add named keys to arrays of objects
## Dev Dependencies
- [chai](https://github.com/chaijs/chai): BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
- [gh-latest-release](https://github.com/shinnn/gh-latest-release): Get the latest published full release for the Github repository
- [json](https://github.com/trentm/json): a 'json' command for massaging and processing JSON on the command line
- [mocha](https://github.com/mochajs/mocha): simple, flexible, fun test framework
- [standard](https://github.com/feross/standard): JavaScript Standard Style
- [standard-markdown](https://github.com/zeke/standard-markdown): Test your Markdown files for Standard JavaScript Style™## License
MIT