1.4.0 • Published 3 years ago

lanyard.js v1.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.3.5

3 years ago

1.2.6

3 years ago

1.3.4

3 years ago

1.2.5

3 years ago

1.3.3

3 years ago

1.2.4

3 years ago

1.3.2

3 years ago

1.2.3

3 years ago

1.3.1

3 years ago

1.2.2

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.9

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

0.0.1-security

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago