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

skopon-shop

v0.1.0

Published

Skopon Bill storefront React components (products, checkout, payment)

Downloads

167

Readme

skopon-shop

完全解耦的 Skopon Bill 消费端 React 组件库:商品列表 / 详情 / 确认订单 / 支付展示。不依赖管理端 front/,不签发 JWT。

安装

npm install skopon-shop
import 'skopon-shop/style.css'
import {
  SkoponBillProvider,
  ProductList,
  ProductDetail,
  OrderConfirm,
} from 'skopon-shop'

鉴权

宿主注入客户端 JWT(POST /api/client-jwt/issue 在服务端签发)。SDK 浏览器端不持有 API_KEY

白名单接口:

  • GET /api/store/productsGET /api/store/products/{id}
  • GET /api/payment-methods(含 currenciesinteractionType
  • POST /api/orders

嵌入示例

function Storefront({ token }: { token: string }) {
  const [view, setView] = useState<'list' | 'detail' | 'confirm'>('list')
  const [productId, setProductId] = useState('')

  return (
    <SkoponBillProvider
      apiBaseUrl="https://bill.example.com"
      token={token}
      currency="CNY"
      onCurrencyChange={(c) => console.log('currency', c)}
      onOrderCreated={(o) => console.log('order', o.uniqueId)}
      onError={(e) => console.error(e)}
    >
      {view === 'list' && (
        <ProductList
          onSelectProduct={(p) => {
            setProductId(p.uniqueId)
            setView('detail')
          }}
        />
      )}
      {view === 'detail' && (
        <ProductDetail
          productUniqueId={productId}
          onCheckout={() => setView('confirm')}
        />
      )}
      {view === 'confirm' && <OrderConfirm productUniqueId={productId} />}
    </SkoponBillProvider>
  )
}

路由由宿主负责;组件不绑定 react-router

确认订单货币规则

  1. GET /api/payment-methods → 网关币种 G + 支付方式。
  2. 无 grant 或 G 为空 →「请联系管理员」。
  3. 用户币种 CC ∈ G ∩ P → 用 C;否则按 G 顺序取第一个属于商品价格集合 P 的币种;交集为空 →「请联系管理员」。
  4. 选 wayCode → 用该项的 interactionType → 下单 → PaymentViewredirect 跳转 / qrcode 二维码。

开发

npm run lint   # tsc
npm run build  # 声明文件 + Vite library (ESM/CJS) + CSS