1.4.0 • Published 4 years ago
lanyard.js v1.4.0
lanyard.js
🏷️ NodeJS Wrapper for Lanyard written using TypeScript
This library is currently still in development and not suggested for production use
Usage Examples
JavaScript
const { Lanyard } = require("lanyard.js");
const userId = "228965621478588416";
// Options can optionally be passed to the constructor when using class methods or to the to the function when directly calling it
const options = {
protocol: "https",
url: "api.lanyard.rest",
}
const lanyard = new Lanyard(options);
// Get data as string
lanyard.getString(userId).then((result) => {
console.log(result);
});
// Get data as object
lanyard.get(userId).then((result) => {
console.log(result);
});
const lanyard = require("lanyard.js");
const userId = "228965621478588416";
// Options can optionally be passed to the constructor when using class methods or to the to the function when directly calling it
const options = {
protocol: "https",
url: "api.lanyard.rest",
}
// Get data as string
lanyard.getString(userId, options).then((result) => {
console.log(result);
});
// Get data as object
lanyard.get(userId, options).then((result) => {
console.log(result);
});
TypeScript
import { Lanyard } from "lanyard.js";
import { RestOptions, LanyardResponse } from "lanyard.js/interfaces";
const userId: string = "228965621478588416";
// Options can optionally be passed to the constructor when using class methods or to the to the function when directly calling it
const options: RestOptions = {
protocol: "https",
url: "api.lanyard.rest",
}
const lanyard: Lanyard = new Lanyard(options);
// Get data as string
lanyard.getString(userId).then((result: string) => {
console.log(result);
});
// Get data as object
lanyard.get(userId).then((result: LanyardResponse) => {
console.log(result);
});
import * as lanyard from "lanyard.js";
import { RestOptions, LanyardResponse } from "lanyard.js/interfaces";
const userId: string = "228965621478588416";
// Options can optionally be passed to the constructor when using class methods or to the to the function when directly calling it
const options: RestOptions = {
protocol: "https",
url: "api.lanyard.rest",
}
// Get data as string
lanyard.getString(userId, options).then((result: string | undefined) => {
console.log(result);
});
// Get data as object
lanyard.get(userId, options).then((result: LanyardResponse | undefined) => {
console.log(result);
});
1.4.0
4 years ago
1.5.0-dev.2db2c4e
4 years ago
1.2.8
4 years ago
1.2.7
4 years ago
1.3.5
4 years ago
1.2.6
4 years ago
1.3.4
4 years ago
1.2.5
4 years ago
1.3.3
4 years ago
1.2.4
4 years ago
1.3.2
4 years ago
1.2.3
4 years ago
1.3.1
4 years ago
1.2.2
4 years ago
1.3.0
4 years ago
1.2.1
4 years ago
1.2.9
4 years ago
1.2.0
4 years ago
1.1.1
4 years ago
1.1.9
4 years ago
1.1.8
4 years ago
1.1.7
4 years ago
1.1.6
4 years ago
1.1.5
4 years ago
1.1.4
4 years ago
1.1.3
4 years ago
1.1.2
4 years ago
1.1.0
4 years ago
1.0.9
4 years ago
1.0.8
4 years ago
0.0.1-security
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago