A fast, resilient, and fully type-safe TypeScript scraper engine built specifically for official Tribhuvan University administrative portals across 8 faculties and institutes.
All scrapers query only verified Tribhuvan University administrative domains (iost.tu.edu.np, ioe.tu.edu.np, iom.tu.edu.np, etc.). No third-party blogs or unverified aggregators are queried.
npm install tu-scraperimport { getNotices, getLatest, getNoticeDetail } from 'tu-scraper';
// 1. Fetch recent notices from IOST (Science & Technology)
const notices = await getNotices('iost', { timeout: 8000 });
console.log(`Fetched ${notices.length} notices from IOST`);
// 2. Fetch single newest notice from Engineering (IOE)
const latestIOE = await getLatest('ioe');
console.log('Latest notice:', latestIOE.title);
// 3. Extract deep body text, scanned images, and PDF attachments
if (notices[0]) {
const detail = await getNoticeDetail(notices[0].url, 'iost');
console.log('PDFs:', detail.attachments?.filter(a => a.type === 'pdf'));
console.log('Images:', detail.attachments?.filter(a => a.type === 'image'));
}Built on Node.js native fetch and cheerio HTML parser. Runs in lightweight serverless functions, Edge runtimes, Docker containers, or background cron workers without heavy headless browser binaries.
Many TU notices are published as scanned JPG/PNG images or embedded PDFs. The parser extracts every attachment, resolves relative URLs to absolute CDN links, and classifies them by MIME type.
Structured error classes including InvalidSourceError, NetworkError, RateLimitError, and ParserError allow programmatic handling.
Built-in memory cache minimizes redundant requests to university servers while configurable concurrency limits prevent rate-limiting when querying 'all' sources.
| Source Key | Institution Name | Category | Official Domain | Action |
|---|---|---|---|---|
| "iost" | Institute of Science and Technology | Institute | iost.tu.edu.np | |
| "fohss" | Faculty of Humanities and Social Sciences | Faculty | fohss.tu.edu.np | |
| "ioe" | Institute of Engineering | Institute | ioe.tu.edu.np | |
| "iom" | Institute of Medicine | Institute | iom.tu.edu.np | |
| "iaas" | Institute of Agriculture and Animal Science | Institute | iaas.tu.edu.np | |
| "iof" | Institute of Forestry | Institute | iof.tu.edu.np | |
| "foe" | Faculty of Education | Faculty | foe.tu.edu.np | |
| "fol" | Faculty of Law | Faculty | fol.tu.edu.np |