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

@usethink/mach-calculators

v0.1.4

Published

数控加工工时、切削参数、成本与报价计算器公式库

Readme

@usethink/mach-calculators

数控加工工时、切削参数、成本与报价计算器公式库。

本包由原 @eforge/mach-formulas@eforge/mach-calculators 合并而来。合并后的职责是:

  • formulas:数控加工公式、成本、工时、切削参数与综合报价计算。
  • schema:计算器动态表单和结果展示 schema。
  • adapters:把表单输入适配到公式函数的薄封装。

安装

npm install @usethink/mach-calculators

使用

import { calculateComprehensiveQuote } from '@usethink/mach-calculators';

const quote = calculateComprehensiveQuote({
  processingFee: 500,
  materialFee: 200,
  complexity: 'medium',
  precision: 'general',
  surface: 'general',
  batchSize: 100,
  profitMargin: 0.2,
  taxRate: 0.13,
});

也可以按模块导入:

import { calculateComprehensiveQuote } from '@usethink/mach-calculators/formulas';
import { comprehensiveQuoteSchema } from '@usethink/mach-calculators/schema';
import { comprehensiveQuoteAdapter } from '@usethink/mach-calculators/adapters';

开发

npm install
npm run type-check
npm test
npm run build
npm pack --dry-run

发布

发布流程使用 @usethink/publish-toolkit,并显式走 npm 发布路径:

  1. 确认 package.json 版本号已更新。
  2. 确认 GitHub 仓库配置了 NPM_TOKEN secret。
  3. 推送 v* tag 触发 .github/workflows/publish.yml
  4. 或在 GitHub Actions 手动触发 Publish workflow。
# 1. 更新 package.json/package-lock.json 版本,例如:
npm version patch --no-git-tag-version

# 2. 提交后打同版本 tag,触发 GitHub Action 发布:
VERSION=$(node -p "require('./package.json').version")
git tag "v${VERSION}"
git push origin "v${VERSION}"

# 3. 发布完成后,下游站点更新依赖:
# npm install @usethink/mach-calculators@${VERSION}

注意:GitHub Action 会跳过已经存在于 npmjs 的同版本包,因此每次公式变更必须先提升版本号。

@usethink/[email protected] 已修复此前的 pnpm 误判问题:默认使用 npm、精确检查 package@version、通过临时 npm userconfig 注入认证,并避免把 token 写入项目目录。本包保留 npm lockfile,CI 中使用 npm ci 安装依赖。