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

@noorkaru/prisma-client

v0.0.3

Published

TypeScript SDK for Prisma Market API - product browsing, search, and category navigation

Downloads

159

Readme

@noorkaru/prisma-client

TypeScript SDK for Prisma Market API - product browsing, search, and category navigation for the Estonian grocery store chain.

Features

  • Text search across all products with sorting and pagination
  • Category browsing with optional filtering
  • Label filters - vegan, gluten-free, organic, discounted, etc.
  • Batch product lookup by EAN barcodes
  • Category navigation tree
  • Store information retrieval
  • Fully typed with TypeScript
  • Formatted responses - no raw API response handling needed

Installation

npm install @noorkaru/prisma-client

Quick Start

import { PrismaClient } from '@noorkaru/prisma-client';

const client = new PrismaClient({
  storeId: '542860184' // Optional, defaults to store ID 542860184
});

// Text search
const results = await client.products.search('piim', { limit: 10 });
console.log(`Found ${results.total} products`);
results.items.forEach(product => {
  console.log(`${product.name} - ${product.price}€`);
  console.log(`  Unit price: ${product.comparisonPrice}€/${product.comparisonUnit}`);
});

// Get product details
const product = await client.products.getDetails('4740125120059');
console.log(product.name, product.price);

API Reference

Products

search(query: string, options?: SearchOptions)

Text search across all products.

const results = await client.products.search('piim', {
  limit: 24,
  from: 0,
  orderBy: 'price',
  order: 'asc'
});

Options:

  • limit (number, max 120): Results per page. Default: 24.
  • from (number): Starting index for pagination. Default: 0.
  • orderBy ('price' | 'comparisonPrice' | 'name' | 'score'): Sort field.
  • order ('asc' | 'desc'): Sort direction.
  • availabilityDate (string): Filter by availability date.
  • labels (ProductLabel[]): Label filters.

browse(slug?: string, options?: SearchOptions)

Browse products by category, or all products if no slug provided.

// Browse a category
await client.products.browse('piim-munad-ja-rasvad', { limit: 20 });

// Browse all products
await client.products.browse();

getDetails(ean: string)

Get detailed product information by EAN barcode.

const product = await client.products.getDetails('4740125120059');

getByEans(eans: string[])

Batch lookup multiple products by EAN barcodes.

const products = await client.products.getByEans([
  '4740125120059',
  '4740125120011'
]);

Label Convenience Methods

All methods accept optional SearchOptions to control pagination, sorting, and category filtering.

// All discounted products, paginated
await client.products.getDiscounted({ limit: 24, from: 24 });

// Discounted in a category
await client.products.getDiscounted({
  slug: 'food-market',
  limit: 10
});

// Vegan products, sorted by price
await client.products.getVegan({
  orderBy: 'price',
  order: 'asc'
});

Available methods:

  • getDiscounted(options?)
  • getVegan(options?)
  • getGlutenFree(options?)
  • getLactoseFree(options?)
  • getLowLactose(options?)
  • getOrganic(options?)
  • getFrozen(options?)

Categories

getNavigationMenu()

Get the full category navigation tree.

const categories = await client.categories.getNavigationMenu();
// Returns Category[] with { name, slug, children? }

Stores

getInfo(storeId?: string)

Get store information.

const store = await client.stores.getInfo();
console.log(store.brand, store.coOperative);

Response Types

FormattedProduct

interface FormattedProduct {
  name: string;
  ean: string;
  price?: number;
  regularPrice?: number;        // Set when onCampaign is true
  onCampaign: boolean;
  url: string;                   // Full product URL
  imageUrl?: string;             // Product image URL
  category?: string;             // Top-level category name
  comparisonPrice?: number;      // Unit price (e.g., per liter)
  comparisonUnit?: string;       // Unit (e.g., "LTR", "KG")
  nutrients?: NutrientInfo[];    // Nutritional information (only in getDetails)
}

SearchResult

interface SearchResult {
  items: FormattedProduct[];
  total: number;                 // Total results available
}

Category

interface Category {
  name: string;
  slug: string;
  children?: Category[];
}

NutrientInfo

interface NutrientInfo {
  nutrients: Nutrient[];
  referenceQuantity: string;      // e.g., "100 ml", "100 g"
  referenceQuantityType: string;  // e.g., "MEASUREMENT"
}

interface Nutrient {
  name: string;                   // e.g., "Energia", "Rasvad", "Valgud"
  value: string;                  // e.g., "55 kcal", "2,5 g"
  recommendedIntake?: string;     // Optional recommended daily intake
}

Pagination Example

// Page 1
const page1 = await client.products.search('piim', {
  limit: 24,
  from: 0
});

// Page 2
const page2 = await client.products.search('piim', {
  limit: 24,
  from: 24
});

console.log(`Showing ${page1.items.length} of ${page1.total} total`);

Sorting Example

// Cheapest first
await client.products.search('piim', {
  orderBy: 'price',
  order: 'asc'
});

// Best unit price
await client.products.search('piim', {
  orderBy: 'comparisonPrice',
  order: 'asc'
});

// Alphabetical
await client.products.search('piim', {
  orderBy: 'name',
  order: 'asc'
});

Development

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

License

ISC