Wrapzone is a Wrapper for the Call of Duty® Modern Warfare (2019) API.
It aims to simplify parsing the huge JSON-File returned from the API endpoint.
npm install wrapzoneconst Wrapzone = require("wrapzone").default;
const platform = "<platform>" // psn | xbl | battle
const userName = "<userName>" // Username (include id for battle.net like name#12345)
await Wrapzone.authenticate('<ActivisionEmail>', '<ActivisionPassword>')
const player = await Wrapzone.get(platform, userName);A Wrapzone instance queries the API only once on instantiation to reduce unnecessary traffic.
It can be updated manually via
player.updatePlayerData() // Uses the saved platform and userName to fetch the dataplayer.setPlayerData(platform, userName) // Uses the provided platform and userName to fetch the dataNote: Both of these methods are async since the API is queried and should be awaited
All other methods on a Wrapzone object can be used to query the retrieved data. They are all synchronous.
A full documentation of all methods and types can be found here.
const raw = player.rawUntil this package covers all properties, the raw untyped json data can be retrieved to use how you want to.
The Wrapzone object can still be used to wrap the call to the API.
If you want to contribute to this project or create your own fork check out the instructions here.
- Node v12+
- Clone the project
- Run
npm install
You can now run npm start to run the application.
If you want to contribute to this project:
- Create a fork
- Create a new branch
- Create a pull request on this repository