luckperms-rest
v1.0.11
Published
API Client for LuckPerms Rest API
Downloads
3
Readme
Luckperms Rest Client
Node.JS client for the Luckperms rest-api project.
Installing
Using NPM:
$ npm install --save luckperms-rest
Using yarn:
$ yarn add luckperms-rest
Example
const { LuckpermsClient } = require("luckperms-rest");
let client = new LuckpermsClient({
url: 'http://my-server:8080',
apiKey: '<your API key>'
});
async function main() {
let userList = await client.getUsers();
for (const uuid of userList) {
let user = await client.getUser(uuid);
let flyNodes = user.nodes.filter(node => node.key === "essentials.fly");
if (flyNodes.length) {
await client.deleteUserNodes(uuid, flyNodes);
}
}
}
main();
Documentation
See the API Documentation.