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

librinth

v0.1.0

Published

Simple TypeScript API wrapper for Modrinth with mock data support

Readme

librinth

A simple, modern TypeScript API wrapper for Modrinth with built-in mock data support.

npm version License: MIT

Features

  • 🚀 Simple and intuitive API
  • 📦 Built-in TypeScript support
  • 🎭 Mock data for testing and development
  • 🔧 Compatible with Node.js 16+
  • 📝 Comprehensive type definitions
  • 🎯 Zero dependencies (runtime)

Installation

Using pnpm (recommended):

pnpm add librinth

Using npm:

npm install librinth

Using yarn:

yarn add librinth

Quick Start

import { LibrinthClient } from 'librinth';

// Create a client with mock data (default)
const client = new LibrinthClient();

// Search for projects
const results = await client.searchProjects('sodium');
console.log(results.hits);

// Get a specific project
const project = await client.getProject('sodium');
console.log(project?.title);

// Get project versions
const versions = await client.getProjectVersions('AANobbMI');
console.log(versions);

Usage

Client Options

const client = new LibrinthClient({
  useMockData: true, // Use mock data (default: true)
  baseUrl: 'https://api.modrinth.com/v2', // API base URL
  userAgent: 'my-app/1.0.0', // Custom user agent
});

Available Methods

getProject(idOrSlug: string): Promise<Project | null>

Get a project by its ID or slug.

const project = await client.getProject('sodium');

searchProjects(query: string, limit?: number): Promise<SearchResult>

Search for projects matching a query.

const results = await client.searchProjects('optimization', 20);

getProjectVersions(projectId: string): Promise<Version[]>

Get all versions for a specific project.

const versions = await client.getProjectVersions('AANobbMI');

getVersion(versionId: string): Promise<Version | null>

Get a specific version by its ID.

const version = await client.getVersion('version-1');

getUser(idOrUsername: string): Promise<User | null>

Get a user by their ID or username.

const user = await client.getUser('jellysquid3');

TypeScript Support

This library is written in TypeScript and includes comprehensive type definitions:

import type { Project, Version, User, SearchResult } from 'librinth';

Mock Data

By default, the client uses mock data for testing and development. To use real API calls (when implemented), set useMockData: false:

const client = new LibrinthClient({ useMockData: false });

Development

Prerequisites

  • Node.js 16 or higher
  • pnpm

Setup

# Install dependencies
pnpm install

# Build the library
pnpm run build

License

MIT License - Copyright (c) 2025 Keira Hopkins and contributors

See LICENSE for details.

Modrinth

Modrinth integration, logos, and other Modrinth property (including domain) are copyright Rinth, Inc. This library is not officially affiliated with Modrinth.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Links