Package Exports
- opendota.js
- opendota.js/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (opendota.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
opendota.js
A minimalistic wrapper for the opendota api.
Install
npm install opendota.js
Example Usage
const { OpenDota } = require("opendota.js");
// Remember to store your api keys safely. I recommend using dotenv.
const opendota = new OpenDota("OPTIONAL_API_KEY");
// Search players by personaname
opendota.search({ q: "noob" }).then(response => console.log(response));
// Get the health of the opendota api service
opendota.getHealth().then(response => console.log(response));
// Using async/await syntax
async function awaitDemo() {
const response = await opendota.search( { q: "noob" } );
console.log(response);
}
awaitDemo();
Features
- Covers 100% of the 54 opendota api endpoints.
- 0 dependencies.
- Fully documented and tested.
- Respects opendota api rate limits.
- Reduces boilerplate calls to opendota api.
Docs
Documentation can be found in DOCS.md.
Reporting Bugs
Please use the issues tab above.
Development - Run tests
npm run test
Development - Generate Docs
npm run docs
Development - Generate Types
npm run types
Author
👤 Will Lamason
- Website: wmel.us
- Github: @wlamason
Show your support
Give a ⭐️ if this project helped you!
📝 License
Copyright © 2021 Will Lamason.
This project is Apache License 2.0 licensed.