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

ts-our-groceries

v0.1.12

Published

Unofficial TypeScript/Node.js wrapper for the Our Groceries shopping list API

Downloads

214

Readme

ts-our-groceries

Unofficial TypeScript/Node.js wrapper for the Our Groceries shopping list API.

npm version TypeScript

Install

npm install ts-our-groceries
pnpm add ts-our-groceries
yarn add ts-our-groceries

Quick Start

import { OurGroceries } from 'ts-our-groceries'

const og = new OurGroceries()  // uses OUR_GROCERIES_USERNAME/PASSWORD env vars
await og.login()

const lists = await og.getMyLists()
const items = await og.getListItems(lists.shoppingLists[0].id)

Features

| Feature | Description | |---------|-------------| | List Management | Get, create, rename, and delete shopping lists | | Item Operations | Add, remove, update, and cross off items | | Batch Operations | Add/remove/toggle multiple items at once | | Categories | Manage item categories | | Search Helpers | Find lists and items by name | | Session Persistence | Save/restore sessions to avoid repeated logins | | Auto-Retry | Exponential backoff for transient failures | | Type-Safe | Full TypeScript support with runtime validation |

Documentation

Architecture

The library is organized into logical modules:

src/
├── http/        # HTTP client with retry support
├── auth/        # Authentication & session management
├── operations/  # API operations by domain (lists, items, categories)
└── helpers/     # Utility helpers (search)
  • HttpClient - Handles all HTTP communication with auto-authentication
  • Authenticator - Login flow and session extraction
  • SessionManager - Session persistence for avoiding repeated logins
  • Operations - Domain-specific API operations
  • SearchHelpers - Convenient search utilities

Basic Usage

Authentication

// Via environment variables
const og = new OurGroceries()

// Or pass credentials directly
const og = new OurGroceries({
  username: '[email protected]',
  password: 'your-password',
})

await og.login()

Lists

// Get all lists
const { shoppingLists, recipes } = await og.getMyLists()

// Create a new list
await og.createList('Weekly Groceries')

// Rename a list
await og.renameList('list-id', 'New Name')

// Delete a list
await og.deleteList('list-id')

Items

// Get items
const { list } = await og.getListItems('list-id')

// Add item
await og.addItemToList('list-id', 'Milk', { note: '2% organic' })

// Add multiple items
await og.addItemsToList('list-id', [
  { value: 'Milk' },
  { value: 'Bread', categoryId: 'bakery-id' },
])

// Cross off
await og.toggleItemCrossedOff('list-id', 'item-id', true)

// Remove
await og.removeItemFromList('list-id', 'item-id')

Search

// Find a list by name
const list = await og.findListByName('shopping')

// Find items in a list
const items = await og.findItemsByName('list-id', 'milk')

Session Persistence

// Save session
const session = og.getSession()
// Store session somewhere (file, database, etc.)

// Restore later
og.restoreSession(savedSession)

License

MIT

Disclaimer

This is an unofficial wrapper. The Our Groceries API is not publicly documented and may change without notice.

Credits

Ported from py-our-groceries by ljmerza.