Feature Request: Allow installation via `npm` for use in NodeJS services
See original GitHub issueFirstly, thanks for the amazing API.
I see that this package is already available via the npm
registry and can be installed through npm
. However, it looks like it’s primarily optimized for running your own instance of the REST API server. I’m wondering if I could request the ability to install this package as an on-demand utility for making requests for OW stats instead. My use case is to use this package inside a Discord bot, so I have no need to run a standalone srv
service with the API. I just need to make on-demand requests to the Overwatch stats from time to time.
My expectation is that I would be able to:
npm install overwatch-api
- Then import it into NodeJS service as
import OverwatchAPI from 'overwatch-api'
- Then use either the
profile
orstats
parsers directly via OverwatchAPI.profile('us', 'pc', 'sometag-123', (response) => { console.log(response); })
However, at the moment there are a few issues preventing me from using this package this way:
- The package is written with ES6 modules and cannot be easily imported as needed above. In order for this to work, you’d need to add a prepublish script to generate CommonJS modules in the output before publishing the package on
npm
. - There is no
index.js
file that exports all the available parser utility functions. - The
main
andmodule
keys inpackage.json
aren’t setup correctly
If you don’t object to this, I’d be happy to create a pull request with the needed changes.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (9 by maintainers)
Ah, my bad! I completely missed the new API docs. It works great. Thank you so much!
Right, currently I’m publishing the root as
overwatch-api-server
, and the client withinapi/package.json
asoverwatch-api
to be the client api as two separate packages. Is that different from what you are saying?