@lookups/usernames
v0.0.7
Published
https://github.com/pqpcara/usernames
Downloads
23
Maintainers
Readme
@lookups/usernames
Fast username availability checker for multiple platforms. Now supports Discord, GitHub, Instagram, Roblox, and Minecraft.
Installation
npm install @lookups/usernames
# or
pnpm add @lookups/usernames
# or
yarn add @lookups/usernamesQuick Start
ESM / TypeScript:
import { Client } from "@lookups/usernames";
const client = new Client();
async function main() {
const discord = await client.discord("alwayswealthy");
const github = await client.github("pqpcara");
const instagram = await client.instagram("muitaura");
const roblox = await client.roblox("pqpcara");
const minecraft = await client.minecraft("pqpcara");
console.log({ discord, github, instagram, roblox, minecraft });
}
main();CommonJS (dynamic import):
(async () => {
const { Client } = await import("@lookups/usernames");
const client = new Client();
const result = await client.github("pqpcara");
console.log(result);
})();Example output (Discord):
{
"platform": "discord",
"username": "alwayswealthy",
"available": false,
"message": "Username alwayswealthy is not available."
}Example output (GitHub):
{
"platform": "github",
"username": "pqpcara",
"available": false,
"suggestions": "pqpcara-dev, pqpcara2, or pqpcara232 are available.",
"message": "Username pqpcara is not available."
}Example output (Instagram):
{
"platform": "instagram",
"username": "muitaura",
"available": true,
"message": "Username is available"
}Example output (Roblox):
{
"platform": "roblox",
"username": "pqpcara",
"available": true,
"message": "Username is available"
}Example output (Minecraft):
{
"platform": "minecraft",
"username": "pqpcara",
"available": true,
"message": "Username is available"
}Usage Examples
Check a single username:
import { Client } from "@lookups/usernames";
const client = new Client();
const res = await client.github("pqpcara");
if (res.available === true) {
console.log(`Available: ${res.username}`);
} else if (res.available === false) {
console.log(`Unavailable: ${res.username}`);
if (res.suggestions) console.log("Suggestions:", res.suggestions);
} else {
console.log("Undetermined:", res.message);
}Check multiple usernames in parallel:
import { Client } from "@lookups/usernames";
const client = new Client();
async function checkMany(usernames: string[]) {
const [discord, github, instagram, minecraft, roblox] = await Promise.all([
Promise.all(usernames.map((u) => client.discord(u))),
Promise.all(usernames.map((u) => client.github(u))),
Promise.all(usernames.map((u) => client.instagram(u))),
Promise.all(usernames.map((u) => client.minecraft(u))),
Promise.all(usernames.map((u) => client.roblox(u))),
]);
return { discord, github, instagram, minecraft, roblox };
}
checkMany(["pqpcara", "muitaura"]).then(console.log);Gentle concurrency (helps avoid bot detection):
import { Client } from "@lookups/usernames";
const client = new Client();
async function serial(usernames: string[]) {
const out = [];
for (const u of usernames) {
out.push(await client.instagram(u));
await new Promise((r) => setTimeout(r, 500 + Math.random() * 700));
}
return out;
}Supported Platforms
- Roblox
- GitHub
- Minecraft
- Roblox
Planned:
- Twitter/X, TikTok, Reddit, and more (PRs welcome)
Changelog
- Releases: https://github.com/pqpcara/usernames/releases
- Commit history: https://github.com/pqpcara/usernames/commits/main
