
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
pactify-api
Advanced tools
A simple API wrapper for Pactify - see https://www.pactify.fr/. It returns data from https://www.pactify.fr/api/player, https://www.pactify.fr/api/faction and https://www.pactify.fr/api/ranking.
Due to the simplicity of the API, I think there is no need to write a long documentation, theses examples clearly show how to use it. If you want more details, methods and properties are also explained using JSDoc.
const { Player, Faction, Ranking } = require('pactify-api');
The only guaranteed properties are id, name, registrationDate, lastActivityDate, activityTime, online.
Player.fromName('username').then(player => {
console.log(player);
}).catch(error => {
console.log(error.error);
});
const player = new Player('id');
player.fetch().then(() => {
console.log(player);
}).catch(error => {
console.log(error.error);
});
Faction.fromName('FAC').then(faction => {
console.log(faction);
}).catch(error => {
console.log(error.error);
});
const faction = new Faction('id');
faction.fetch().then(() => {
console.log(faction);
}).catch(error => {
console.log(error.error);
});
const ranking = new Ranking('latest');
// you can also specify a YYYY-MM formatted month (e.g. 2020-05) instead of 'latest':
// const ranking = new Ranking('2020-05');
ranking.fetch().then(() => {
console.log(ranking);
}).catch(error => {
console.log(error.error);
});
Errors returned by the API are objects containing a statusCode and an error property:
| statusCode | error |
|---|---|
0 | no error |
1 | internal error (which surely comes from a connection error from you or the server) |
2 | unknown player |
3 | unknown faction |
When parsing an object, you can have properties containing other data type. For instance, when you parse a Player, if he is in a faction, the faction Player property will result in a Faction object. This object is partial, which means you cannot expect it to have any information beside its ID.
You can know whether a data is partial by checking its partial property. The only data you can expect to don't be partial are these fetched with fetch or fromName methods.
This example simply requests a player, then retrieves information from its faction. While the first log will only show the faction ID, the second will display all the property of the faction.
Player.fromName('username').then(async player => {
if (player.faction) {
console.log(player.faction);
await player.faction.fetch();
console.log(player.faction);
}
else
console.log('This player is not in a faction.');
}).catch(error => {
console.log(error.error);
});
FAQs
A simple API wrapper for Pactify - see https://www.pactify.fr/.
We found that pactify-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.