The official zero-dependency client SDK for checking smart driving license print status via the mirrored Department of Transport Management (DOTM) database in Nepal. Works seamlessly across Node.js (18+), Bun, Deno, Next.js, Vite, React Native, and standard browsers.
Install from the official npm Registry or GitHub Packages.
The core function checkLicense() validates, normalizes, and fetches print status.
import { checkLicense } from 'nepal-license-checker';
async function checkMyLicense() {
// Supports English (01-01-12345678) or Nepali digits (०१-०१-१२३४५६७८)
const result = await checkLicense('01-01-12345678', {
apiKey: 'nlc_live_your_api_key_here', // Optional: unlocks 60 req/min
});
if (result.status === 'success') {
if (result.isReady && result.data) {
console.log('🎉 License is printed and ready for pickup!');
console.log('Holder Name:', result.data.holder_name);
console.log('Office: ', result.data.office);
console.log('Category: ', result.data.category);
} else {
console.log('⏳ License is not yet printed by DOTM.');
}
} else {
console.error('Error:', result.error);
if (result.statusCode === 429) {
console.log('Wait seconds before retrying:', result.retryAfter);
}
}
}
checkMyLicense();Unlock higher throughput for production apps and bots.
15 req / min
Applied per client IP. If exceeded, a 5-minute spam lockout is applied. Ideal for individual manual lookups.
60 req / min
Key-based quota with zero lockout penalty. Returns RFC-compliant rate limit response headers.
Sign in with GitHub on our Developer Portal to generate up to 3 keys instantly.
These helpers run 100% locally with zero network calls and zero dependencies.
validateLicenseNumber(license: string): booleanOffline RegexValidates whether a string matches the required Nepal driving license pattern XX-XX-XXXXXXXX. Seamlessly supports both English (0-9) and Nepali Devanagari numerals (०-९).
validateLicenseNumber('01-01-12345678'); // true
validateLicenseNumber('०१-०१-१२३४५६७८'); // true
validateLicenseNumber('12-34-5678'); // falseformatLicenseNumber(input: string): stringInput MaskingFormats raw numeric inputs into the standard hyphenated XX-XX-XXXXXXXX pattern. Perfect for form auto-formatting on user input.
formatLicenseNumber('010112345678'); // '01-01-12345678'
formatLicenseNumber('०१०११२३४५६७८'); // '01-01-12345678'devanagariToAsciiDigits(str) / asciiToDevanagariDigits(str)Numeral ConverterBidirectional numeral conversion between Nepali Devanagari (०-९) and Western ASCII (0-9).
devanagariToAsciiDigits('०१-०१-१२३४५६७८'); // '01-01-12345678'
asciiToDevanagariDigits('01-01-12345678'); // '०१-०१-१२३४५६७८'Test how the offline SDK functions format and validate numbers in real-time.
Valid (XX-XX-XXXXXXXX)
01-02-12345678
०१-०२-१२३४५६७८
01-02-12345678
The package includes full .d.ts typings out of the box.
export interface LicenseData {
holder_name: string; // Full name of driver
license_number: string; // Formatted license number
office: string; // Yatayat Karyalaya issued
category: string; // Categories (e.g. "A, B")
createdAt: string; // Indexed date timestamp
updatedAt: string; // Last sync date timestamp
}
export interface RateLimitInfo {
limit?: number; // Rate limit ceiling (e.g. 60)
remaining?: number; // Remaining requests in window
reset?: number; // Unix epoch reset timestamp
}
export type CheckLicenseResult =
| {
status: 'success';
isReady: boolean;
data: LicenseData | null;
message?: string;
statusCode: number;
rateLimit?: RateLimitInfo;
}
| {
status: 'error';
isReady: false;
data: null;
error: string;
retryAfter?: number;
statusCode?: number;
rateLimit?: RateLimitInfo;
};For applications written in Python, Go, PHP, Java, or Rust.
| Parameter / Header | Type | Required | Description |
|---|---|---|---|
| number | query string | Yes | License number in XX-XX-XXXXXXXX format |
| x-api-key | header | Optional | Developer key for 60 req/min rate limit quota |
| Authorization | header | Optional | Bearer <apiKey> alternative |