Apex Battle Pass Calculator
A small, simple package for quick calculations for the Apex Battle Pass system.
Installation
As CLI (recommended)
- npm
- yarn
- pnpm
npm install -g @yoshiboi18303/apex-bp-calculator
yarn global add @yoshiboi18303/apex-bp-calculator
pnpm add -g @yoshiboi18303/apex-bp-calculator
Then run this:
abp
Learn more about how to use the CLI here
OR
Learn about what options the CLI supports here
As npm package
I would strongly recommend to use this package as a CLI, rather than use this method. If you're making a project that utilizes this, go ahead and continue.
- npm
- yarn
- pnpm
npm install @yoshiboi18303/apex-bp-calculator
yarn add @yoshiboi18303/apex-bp-calculator
pnpm add @yoshiboi18303/apex-bp-calculator
Afterwards, open your project with your favorite editor and put this into a JavaScript file:
const bpCalculator = require("@yoshiboi18303/apex-bp-calculator");
console.log(bpCalculator.calculate(1, 10, 0)); // => 90
If you'd like to use TypeScript rather than JavaScript, the Apex Battle Pass Calculator has TypeScript support. Open a TypeScript file, then put this in there:
import calculate from "@yoshiboi18303/apex-bp-calculator";
console.log(calculate(1, 10, 0)); // => 90
Why does the TypeScript file not use bpCalculator.calculate
like the JavaScript file does?
This TypeScript file is importing calculate
which is a default
import, TypeScript when used with this specific import syntax, will look for a default import in the main
file.
In this case, the calculate
function.
JavaScript does not do this, you'll have to do bpCalculator.default()
in JavaScript code.
Learn more about the methods in the package here