2.0.2 • Published 4 years ago
splatoon2.ink.js v2.0.2
splatoon2.ink.js
splatoon2.ink.js is a package connected to the splatoon2.ink api to get actual and next stages.
Installation
Use npm to install this package (there).
npm i --s splatoon2.ink.js
Usage
Get stages:
const api = require('splatoon2.ink.js')
const Client = new api.Client("en"); // You can define your language between english and french (en or fr)
Client.getStages(function(res) {
console.log(res.first)
console.log(res.next)
})
This should return you the following elements :
{
ranked: {
stage_a: {
name: 'Stage a name',
image: 'Stage a image url'
},
stage_b: {
name: 'Stage b name',
image: 'Stage b image url'
},
mode: 'Ranked mode'
},
league: {
stage_a: {
name: 'Stage a name',
image: 'Stage a image url'
},
stage_b: {
name: 'Stage b name',
image: 'Stage b image url'
},
mode: 'League mode'
},
regular: {
stage_a: {
name: 'Stage a name',
image: 'Stage a image url'
},
stage_b: {
name: 'Stage a name',
image: 'Stage a image url'
},
mode: 'Regular Battle'
},
starts_at: "Started/starts at timestamp",
ends_at: "Ends at timestamp"
}
Change language:
const api = require('splatoon2.ink.js');
const Client = new api.Client();
Client.setLanguage("fr") // should return true, and the lang has been changed to french.
Get salmon run stages
const api = require('./sp2.index.js')
const Client = new api.Client("fr")
Client.getSalmon((done) => {console.log(done[0].weapons[0])})
At the moment, the salmon run stages names are not impacted by translation.
This readme will be updated when new things go to the api.
Liscence
Github repo
https://github.com/korobot/splatoon2.ink.js
Patch note
2.0.2: Updated readme 2.0.0: Added salmon run stages 1.0.5: Minor translation fixes causing undefined.