Welcome to Wrapzone 👋
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 wrapzone
Initialize a Wrapzone instance
const Wrapzone = default;const platform = "<platform>" // psn | xbl | battleconst userName = "<userName>" // Username (include id for battle.net like name#12345)await Wrapzoneconst player = await Wrapzone;
Updating a Wrapzone instance
A Wrapzone instance queries the API only once on instantiation to reduce unnecessary traffic.
It can be updated manually via
player // Uses the saved platform and userName to fetch the data
player // Uses the provided platform and userName to fetch the data
Note: 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.
Getting the raw json
const raw = playerraw
Until 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.