@bitbybit-dev/base

中文文档
1.6.0发布于 2026/10/29MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 2.3万

Bit By Bit Developers Base CAD Library to Program Geometry

原始使用文档
文档目录12 节
  1. Overview
  2. Used By
  3. Quick Start
  4. Use It With an AI Agent
  5. Links
  6. API reference
  7. Example Applications
  8. Development
  9. Bitbybit Platform
  10. Support the Project
  11. Community
  12. License

@bitbybit-dev/base

Base algorithms for Bitbybit CAD platform - math, vectors, matrices, lists, text utilities, and shared types used across all higher-level packages.

Picture showing bitbybit.dev platform

Overview

This package provides the foundational layer for all Bitbybit CAD packages. It includes helper functions for math, text, lists, vectors, and matrix operations, along with base types used throughout the platform. This layer is kept lightweight with zero third-party dependencies.

Works in both Node.js and browser environments.

Used By

This package is a dependency of all higher-level Bitbybit packages:

Quick Start

The fastest way to start a project using Bitbybit packages:

npx @bitbybit-dev/create-app my-project

This scaffolds a complete Vite + TypeScript project with all CAD kernels pre-configured. Learn more about the CLI.

Use It With an AI Agent

An agent that does not know an API invents plausible names for it, and Bitbybit has more functions across its three CAD kernels than any model holds in memory. The free Bitbybit CAD MCP server removes the guesswork: your agent looks up the exact signature, parameter defaults, return type and examples for the version of @bitbybit-dev/base your project has installed, and writes code that compiles the first time.

claude mcp add --transport http bitbybit https://mcp.bitbybit.dev/mcp

Cursor, VS Code, claude.ai, ChatGPT and the Claude API connect to the same endpoint; npx -y @bitbybit-dev/mcp runs the same server locally, pinned to your installed version. Every configuration is here.

With a CAD Cloud key, the Bitbybit CAD Cloud MCP goes further and lets the agent run the geometry for you - measure a STEP file, run a pipeline, convert to glTF - and hand back the results as files. For assistants that cannot speak MCP, the whole API is also published as context files. The AI section of the documentation explains all of it.

ResourceURL
GitHubhttps://github.com/bitbybit-dev/bitbybit/tree/master/packages/dev/base
Monorepohttps://github.com/bitbybit-dev/bitbybit
NPMhttps://www.npmjs.com/package/@bitbybit-dev/base
Documentationhttps://learn.bitbybit.dev/learn/npm-packages/intro
API Referencehttps://docs.bitbybit.dev/modules/Bit
Unit Test Coveragehttps://github.com/bitbybit-dev/bitbybit/actions/workflows/verify.yml

API reference

Every class, method and input type in this package is documented in the generated TypeScript API reference:

Example Applications

AppSource Code
Hex ShellGitHub
Cup ConfiguratorGitHub
Terrace Furniture (BabylonJS)Closed source

Development

# Build package
npm run build-p

# Run unit tests with coverage
npm run test:coverage

# Re-run them as you edit
npm run test:watch

Bitbybit Platform

Beyond NPM packages, Bitbybit offers:

  • Visual Programming Editors - Rete & Blockly drag-and-drop 3D modeling, plus a Monaco TypeScript editor
  • CAD Cloud API - Build full pipelines that compose all Bitbybit algorithms, where each step can reference outputs of previous steps. Supports parametric model generation, STEP-to-glTF conversion, and complex CAD workflows via HTTP
  • Bitbybit Studio - A growing visual dashboard where API Key users can generate models, convert files, build pipelines with a GUI, inspect tasks, and preview 3D results
  • 3D Bits for Shopify - Interactive 3D product configurators for e-commerce
  • Script Runners - Execute visual scripts directly on your website
  • Built for AI Coding Agents - The free Bitbybit CAD MCP gives Claude Code, Cursor, VS Code, claude.ai and ChatGPT the exact API of the version you use; with a key, the CAD Cloud MCP runs the geometry too
  • Business & Enterprise - We help businesses and enterprises develop custom applications and spin up optimized CAD tenant workflows on our managed servers

Support the Project

This package is part of the open-source Bitbybit ecosystem. Your subscription helps fund continued development.

⭐ Subscribe - Silver or Gold plan | Get API Key for CAD Cloud

Community

License

MIT © Bit By Bit Developers

版本与发布记录

@bitbybit-dev/base 共发布 53 个版本,首次发布于 2024/11/26;过去 12 个月发布了 30 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.6.0latest2026/10/2910 天前
1.6.0-rc.0rc2026/10/2811 天前
1.5.02026/10/1227 天前
1.5.0-rc.02026/10/1227 天前
1.4.12026/10/021 个月前
1.4.02026/09/301 个月前

其他发布通道:alpha → 0.19.0-alpha.0,rc → 1.6.0-rc.0。

关于 @bitbybit-dev/base 的常见问题

@bitbybit-dev/base 是什么?

Bit By Bit Developers Base CAD Library to Program Geometry

如何安装 @bitbybit-dev/base?

在项目目录运行 npm install @bitbybit-dev/base,或使用 pnpm add / yarn add / bun add。

@bitbybit-dev/base 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@bitbybit-dev/base 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@bitbybit-dev/base 可以商用吗?

@bitbybit-dev/base 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bitbybit-dev/base 的下载量有多少?

根据 npm 官方下载统计,@bitbybit-dev/base 在 2026/10/08 – 2026/11/06 这 30 天内被下载 23,340 次,日均约 778 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bitbybit-dev/base 还在维护吗?

最新版本 1.6.0 发布于 2026/10/29(10 天前);至今共发布 53 个版本,其中过去 12 个月发布了 30 个;首次发布于 2024/11/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。