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

@devmugi/scryfall-api

v1.0.2

Published

Kotlin Multiplatform library for Scryfall MTG API

Readme

@devmugi/scryfall-api

Scryfall API client for JavaScript and TypeScript. Access the Scryfall Magic: The Gathering card database with full TypeScript support.

Installation

npm install @devmugi/scryfall-api

Quick Start

import { CardsApiJs } from '@devmugi/scryfall-api';

const api = new CardsApiJs();

// Get a random card
const card = await api.random(null);
console.log(`${card.name} - ${card.typeLine}`);

// Search for cards
const results = await api.search({ q: 'lightning bolt' });
console.log(`Found ${results.totalCards} cards`);

// Get card by exact name
const bolt = await api.namedExact({ name: 'Lightning Bolt' });
console.log(bolt.oracleText);

Available APIs

| API | Class | Description | |-----|-------|-------------| | Cards | CardsApiJs | Search, random, named lookup, collection | | Sets | SetsApiJs | Magic set information | | Rulings | RulingsApiJs | Official card rulings | | Catalogs | CatalogsApiJs | Reference data (card names, types, keywords) | | Symbology | CardSymbolApiJs | Mana symbols and cost parsing | | Bulk Data | BulkDataApiJs | Bulk data export metadata |

Cards API Examples

import { CardsApiJs } from '@devmugi/scryfall-api';

const cards = new CardsApiJs();

// Search with Scryfall syntax
const creatures = await cards.search({ q: 't:creature c:red pow>=4' });

// Get card by exact name
const lotus = await cards.namedExact({ name: 'Black Lotus' });

// Get card by fuzzy name
const card = await cards.namedFuzzy({ name: 'jace mind sculptor' });

// Get random card (pass null for no filter)
const random = await cards.random(null);

// Get random card with filter
const randomCreature = await cards.random({ q: 't:creature' });

// Autocomplete card names
const suggestions = await cards.autocomplete({ q: 'lig' });

Sets API Example

import { SetsApiJs } from '@devmugi/scryfall-api';

const sets = new SetsApiJs();

// Get all sets
const allSets = await sets.all();

// Get set by code
const khm = await sets.byCode({ code: 'khm' });
console.log(`${khm.name} - ${khm.cardCount} cards`);

TypeScript Support

This package includes TypeScript declarations (.d.mts). All card properties and API responses are fully typed.

import { CardsApiJs } from '@devmugi/scryfall-api';

const api = new CardsApiJs();

async function main(): Promise<void> {
    const card = await api.random(null);
    console.log(`${card.name}: ${card.oracleText ?? 'No text'}`);
}

Requirements

  • Node.js 18+ (ESM support)
  • Modern browsers with ES module support

Links

License

MIT