npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@anumiti/netra-node

v2.1.0

Published

Official Node.js/TypeScript SDK for Anumiti NETRA — India's AI document intelligence API

Readme

@anumiti/netra-node

Official Node.js/TypeScript SDK for Anumiti NETRA — India's AI document intelligence API.

Extract structured data from GST invoices, contracts, identity documents, court orders, employment records, and MCA filings with a single function call.

Installation

npm install @anumiti/netra-node
# or
pnpm add @anumiti/netra-node
# or
yarn add @anumiti/netra-node

Quick Start

import { NeTraClient } from '@anumiti/netra-node';
import { readFileSync } from 'fs';

const client = new NeTraClient({
  apiKey: process.env.NETRA_API_KEY!, // anm_ntr_live_...
});

// Extract a GST invoice
const buffer = readFileSync('invoice.pdf');
const result = await client.extractGSTInvoice(buffer, 'invoice.pdf');

console.log(`Trust Score: ${result.trust_score}`);
console.log(`Seller GSTIN: ${result.seller.gstin} (verified: ${result.seller.gstin_verified})`);
console.log(`Grand Total: ₹${result.totals.grand_total?.toLocaleString('en-IN')}`);
console.log(`ITC Eligible: ${result.compliance_flags.itc_eligible}`);

Supported Document Types

| Method | Document Type | Indian Law Coverage | |--------|--------------|---------------------| | extractGSTInvoice() | GST Tax Invoice | CGST/SGST/IGST Act, Section 17(5), HSN validation | | extractGSTCreditNote() | GST Credit Note | Rule 53, CDN reconciliation | | extractGSTEWayBill() | GST E-Way Bill | Rule 138, expiry detection | | extractContract() | Legal Contract | Indian Contract Act 1872, Stamp Act | | extractIdentity() | Aadhaar/PAN/Passport/DL/VoterID | DPDP Act 2023 (masked output) | | extractEmployment() | Salary Slip/Offer Letter/Form 16 | Labour Codes, PF Act, ESI Act | | extractCourtOrder() | Court Orders (HC/SC/District) | CPC, CrPC, civil/criminal orders | | extractCompanyFiling() | MCA ROC Filings | Companies Act 2013 | | verifyGSTIN() | Standalone GSTIN check | GSTN registry via Sandbox.co.in | | verifyPAN() | Standalone PAN check | Income Tax registry |

All Extraction Methods

// GST Documents
const invoice = await client.extractGSTInvoice(file, 'invoice.pdf');
const creditNote = await client.extractGSTCreditNote(file, 'credit-note.pdf');
const ewayBill = await client.extractGSTEWayBill(file, 'eway-bill.pdf');

// Legal
const contract = await client.extractContract(file, 'agreement.pdf');
const courtOrder = await client.extractCourtOrder(file, 'order.pdf');

// Identity (DPDP-compliant — Aadhaar last 4 only, PAN masked)
const identity = await client.extractIdentity(file, 'aadhaar.jpg');

// Employment
const employment = await client.extractEmployment(file, 'salary-slip.pdf');

// Corporate
const filing = await client.extractCompanyFiling(file, 'mgt7.pdf');

// Verification (no file needed)
const gstin = await client.verifyGSTIN('27AAACR5055K1Z5');
const pan = await client.verifyPAN('ABCDE1234F');

Async (Non-blocking) Processing

For large documents or batch workflows:

// Submit and get job ID immediately
const job = await client.submitForProcessing(file, 'large-contract.pdf', {
  document_type: 'contract',
  webhook_url: 'https://your-app.com/webhooks/netra',
});
console.log(`Job ID: ${job.id}`);

// Later — poll status
const status = await client.getDocumentStatus(job.id);
console.log(`Status: ${status.status}`);

// Or block until complete
const completed = await client.waitForDocument(job.id, 2000, 300000);
if (completed.status === 'completed') {
  const result = await client.getDocumentResult<GSTInvoiceResult>(job.id);
}

Error Handling

All errors are typed:

import {
  NeTraClient,
  AuthenticationError,
  RateLimitError,
  DocumentTooLargeError,
  OCRFailedError,
} from '@anumiti/netra-node';

try {
  const result = await client.extractGSTInvoice(file, 'invoice.pdf');
} catch (err) {
  if (err instanceof AuthenticationError) {
    console.error('Invalid API key');
  } else if (err instanceof RateLimitError) {
    console.error('Rate limited — retry after:', err.retryAfterMs, 'ms');
  } else if (err instanceof DocumentTooLargeError) {
    console.error('File too large (max 50MB)');
  } else if (err instanceof OCRFailedError) {
    console.error('OCR failed — try a higher resolution scan');
  }
}

Configuration

const client = new NeTraClient({
  apiKey: 'anm_ntr_live_...',
  baseUrl: 'https://netra.anumiti.in',  // default
  timeout: 60000,                        // 60s default
  maxRetries: 3,                         // default
  retryDelay: 1000,                      // 1s base delay, exponential backoff
});

TypeScript

Full TypeScript support. All response types are exported:

import type {
  GSTInvoiceResult,
  ContractResult,
  IdentityResult,
  EmploymentResult,
  CourtOrderResult,
  GSTINVerificationResult,
} from '@anumiti/netra-node';

Requirements

  • Node.js 18+
  • Uses native fetch (no polyfill needed)

License

MIT — © Anumiti Technologies Pvt Ltd