Skip to content

realdegrees/wrapzone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to Wrapzone 👋

NPM Typedoc NPM

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.

Installation

npm install wrapzone

Usage

Initialize a Wrapzone instance

const 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);

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.updatePlayerData() // Uses the saved platform and userName to fetch the data
player.setPlayerData(platform, userName) // 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 = player.raw

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.

Development

If you want to contribute to this project or create your own fork check out the instructions here.

Prerequisites

  • Node v12+

Setup

  1. Clone the project
  2. Run npm install

You can now run npm start to run the application.

Contributing

If you want to contribute to this project:

  1. Create a fork
  2. Create a new branch
  3. Create a pull request on this repository

About

An optionally typed node wrapper for the Call of Duty: Warzone API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published