mdnman
v1.1.8
Published
Command line interface for the MDN Web Docs
Downloads
663
Readme
MDNMan
JavaScript reference CLI made possible by MDN Web Docs.
Installation
When using mdnman within a JavaScript or TypeScript project, install locally via NPM.
npm install mdnman
If you would like access to the CLI at all times in your terminal, install globally via NPM.
npm install --global mdnman
Usage
Command Line Interface
At it's core, mdnman is a command line interface for the MDN Web Docs. It is intended to be a quick, non-network dependent resource for web developers.
Commands
| Command | Arguments | Description | |---------|------------------|------------------------------------| | js | query (string) | Query the MDN JavaScript reference | | html | query (string) | Query the MDN HTML reference | | css | query (string) | Query the MDN CSS reference | | help | command (string) | Get help for a specific command |
Options
| Option | Flag | Description | Default | Values | |---------|---------------|----------------------------------------------------|---------|---------------------| | Output | -o, --output | Specify where the output of the command should go | stdout | stdout, vim | | Section | -s, --section | Specify a single section of the document to return | none | Any section heading | | Help | -h, --help | Get help for a given command | N/A | Any command |
Examples
mdnman --help
mdnman js map
mdnman --output vim --section parameters splice
Node Package Manager
You can also install mdnman through npm to utilize it in your own project. The mdnman package comes with built in TypeScript support and exposes all utility methods built in to the CLI.
Quick Start
import { getMDNDoc, printDoc } from "mdnman/dist";
const doc = await getMDNDoc('javascript', 'map')
if (doc) {
printDoc(doc);
}
Credits
This project would not be possible without the incredible work done by the Mozilla Team on the MDN Web Docs.
Questions?
If you have any questions about the project you can reach out to me via email or GitHub with the information below.
Email: [email protected] GitHub: Thenlie