A lightweight, cross-platform client for querying the throwaway.cloud API — compatible with browsers, Node.js, and serverless platforms like Cloudflare Workers.
lookup(emailOrDomain)User-AgentUser-Agent, which is enforced)jestnpm install @iocium/throwaway-lookup
import { lookup } from '@iocium/throwaway-lookup';
const result = await lookup('mailinator.com');
if (result.success && result.isDisposable) {
console.log('Disposable detected!');
} else {
console.log('Safe to use.');
}
lookup(subject: string, options?: LookupOptions): Promise<LookupResult>| Parameter | Type | Description |
|---|---|---|
subject |
string |
An email address or domain name to query |
options |
LookupOptions |
Optional object to supply custom headers (except User-Agent) |
LookupOptionsinterface LookupOptions {
headers?: Record<string, string>; // Custom headers
}
LookupResultinterface LookupResult {
success: boolean;
isDisposable?: boolean;
[key: string]: any; // May include additional fields
}
npm test
Includes a full test suite with coverage reports for:
Generate full docs using:
npm run docs
Output is placed in the docs/ directory and includes all exported types and functions.
MIT