electron-api-docs
Electron's API documentation in a structured JSON format.
Installation
npm install electron-api-docs --save
Or take it for a spin in your Node.js REPL:
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 electron-api-docs@1.4.1
, 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:
const apis =
This gives you an object with keys for easy traversal:
apisBrowserWindowinstanceMethodssetAspectRatio
Array Structure
To access the docs as an array of API objects:
const apis =
This gives you an array of API objects, so functional methods like find
,
map
, filter
, and every
can be used:
apisapisapisapis
Keyed Array Structure
For the best of both worlds (arrays and objects), you can require the module as a keyed array:
const apis =
When you require it, you get an array of API objects
apislength// => 33
The array has a key for each API name
, for convenient access:
apisBrowserWindowapisBrowserWindowstaticMethodsgetAllWindowsdescriptionapisWebContentsinstanceMethodssavePageparameterssaveTypepossibleValuesapisappeventsquit
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:
apisapisapisapis // All arrays have named keys, not just the top-level array!apisBrowserWindowinstanceMethods
Tests
npm installnpm test
Dependencies
- keyed-array: Recursively add named keys to arrays of objects
Dev Dependencies
- chai: BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
- gh-latest-release: Get the latest published full release for the Github repository
- json: a 'json' command for massaging and processing JSON on the command line
- mocha: simple, flexible, fun test framework
- standard: JavaScript Standard Style
- standard-markdown: Test your Markdown files for Standard JavaScript Style™
License
MIT