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

deepcitation

v0.2.2

Published

DeepCitation JavaScript SDK for deterministic AI citation verification

Downloads

435

Readme

DeepCitation cover

CI License: MIT Zero Dependencies ~17KB

Documentation · Get API Key · Examples · Agent Integration · Terms · Privacy

DeepCitation demo

We believe AI citations should follow show, don't tell; they should prove their citations so you don't have to blindly chase them down yourself. DeepCitation replaces 'trust me' citations with a deterministic verification layer.

DeepCitation turns model citations into deterministic, inspectable proof.

Install

npm install deepcitation  # or bun add / yarn add / pnpm add

Quick Start

import { DeepCitation, extractVisibleText, wrapCitationPrompt } from "deepcitation";

const deepCitation = new DeepCitation({
  apiKey: process.env.DEEPCITATION_API_KEY,
});

// 1) Process documents 
const { deepTextPromptPortion } = await deepCitation.prepareAttachments([
  { file: pdfBuffer, filename: "report.pdf" },
]);

// 2) Wrap prompts before calling your model
const { enhancedSystemPrompt, enhancedUserPrompt } = wrapCitationPrompt({
  systemPrompt: "You are a helpful assistant...",
  userPrompt: "Summarize the key findings",
  deepTextPromptPortion,
});

const response = await yourLLM.chat({
  system: enhancedSystemPrompt,
  user: enhancedUserPrompt,
});

// 3) Verify citations
const { verifications } = await deepCitation.verify({ llmOutput: response.content });
// IMPORTANT: 'verifications' is a Record<string, Verification> (object map, not an array).
// Use Object.keys(verifications).length to count results, not .length.

// 4) Strip citation metadata before showing model text to users
const visibleText = extractVisibleText(response.content);

Components

A set of high-quality React components to help you build production-ready attribution systems. Skip the complexity of reading multiple file formats, rendering multiple formats, coordinate mapping, and visual proof generation.

Support

Works with any LLM -- OpenAI, Anthropic, Google, AI SDK, local models, or any leading model.

| | | | | | --- | --- | --- | --- | | OpenAI ✔ | Anthropic ✔ | Gemini ✔ | AI SDK ✔ |

Try it now

Clone a working example and have citations running in under 2 minutes:

# Next.js chat app with streaming citations
git clone https://github.com/DeepCitation/deepcitation.git
cd deepcitation/examples/nextjs-ai-sdk
cp .env.example .env.local  # add your API keys
npm install && npm run dev

Examples

Development

Running Tests

# Run unit tests
npm test

# Run Playwright component tests
npm run test:ct

# Run visual snapshot tests
npm run test:ct -- --grep "visual snapshot"

Go deeper

Community

Contributing

See CONTRIBUTING.

License

MIT

Hosted API/service is subject to Terms and Privacy Policy. Patent pending. "DeepCitation" is a trademark.