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

coffee-order-manager

v2.0.0

Published

A simple coffee order management system

Readme

coffee-order-manager

一个简单的咖啡订单管理系统。

安装

npm install coffee-order-manager

使用

const {
  COFFEE_TYPES,
  ORDER_STATUS,
  createOrder,
  getOrders,
  getOrderById,
  updateOrderStatus,
  cancelOrder,
  getStats
} = require('coffee-order-manager');

// 创建订单
const order = createOrder('张三', 'Latte', 'medium', '少糖');

// 查询所有订单
const allOrders = getOrders();

// 按状态筛选
const pendingOrders = getOrders({ status: 'pending' });

// 更新订单状态
updateOrderStatus(order.id, 'preparing');
updateOrderStatus(order.id, 'ready');
updateOrderStatus(order.id, 'completed');

// 取消订单
cancelOrder(order.id);

// 获取统计
const stats = getStats();

API

COFFEE_TYPES

支持的咖啡类型:

  • ESPRESSO - 浓缩咖啡
  • AMERICANO - 美式咖啡
  • LATTE - 拿铁
  • CAPPUCCINO - 卡布奇诺
  • MOCHA - 摩卡
  • COLD_BREW - 冷萃

ORDER_STATUS

订单状态:

  • PENDING - 待处理
  • PREPARING - 制作中
  • READY - 已完成
  • COMPLETED - 已领取
  • CANCELLED - 已取消

createOrder(customerName, coffeeType, size, notes)

创建新订单。

  • customerName - 客户名称
  • coffeeType - 咖啡类型
  • size - 规格 (small/medium/large)
  • notes - 备注

getOrders(filter)

获取订单列表。

  • filter.status - 按状态筛选
  • filter.customerName - 按客户名筛选

getOrderById(id)

根据ID查询订单。

updateOrderStatus(id, status)

更新订单状态。

cancelOrder(id)

取消订单(仅限未完成订单)。

getStats()

获取统计信息(总数、各状态数量、营业额)。

价格表

| 咖啡类型 | 小杯 | 中杯 | 大杯 | |---------|------|------|------| | Espresso | ¥16 | ¥20 | ¥26 | | Americano | ¥18 | ¥22 | ¥29 | | Latte | ¥22 | ¥28 | ¥36 | | Cappuccino | ¥22 | ¥28 | ¥36 | | Mocha | ¥26 | ¥32 | ¥42 | | Cold Brew | ¥20 | ¥25 | ¥33 |

许可证

MIT