@flock/wirespec

中文文档
0.23.7发布于 2026/11/13Apache-2.0TypeScriptES Module零依赖构建来源已验证近 30 天下载 3433

Simplify your API development workflows, accelerate implementation, and guarantee strict adherence to defined contract specifications

原始使用文档
文档目录8 节
  1. Wirespec your API's
  2. Features
  3. Installation
  4. Usage
  5. CLI
  6. Programmatic Usage
  7. Contributing
  8. License

wirespec

npm version license

Wirespec your API's

Simplify your API development workflows, accelerate implementation, and guarantee strict adherence to defined contract specifications

Wirespec is a tool that simplifies interface design using a contract-first approach, with concise, human-readable specifications as the single source of truth.

Visit wirespec.io for more information about the project.

Features

  • Generate Wirespec files: Automatically create Wirespec templates or definitions programmatically.
  • Validation: Ensure your Wirespec files adhere to defined schema and specifications.
  • CLI Support: Easily integrate with your development workflow using simple CLI commands.
  • Integration Ready: Works well with modern JavaScript/TypeScript projects.

Installation

You can install wirespec globally or as a dev dependency in your project:

# Install as a dev dependency
npm install --save-dev wirespec

# Or install globally
npm install -g wirespec

Usage

CLI

The wirespec plugin can be used directly through the command line. Below are some example commands:

# Create a new Wirespec file
wirespec generate <filename>

# Validate an existing Wirespec file
wirespec validate <filename>

Programmatic Usage

You can also use wirespec in your JavaScript or TypeScript code:

import { generate, validate } from 'wirespec';

// Generate a Wirespec file
generate('example.wirespec');

// Validate a Wirespec file
const isValid = validate('example.wirespec');
console.log(`Is valid: ${isValid}`);

Contributing

Contributions are welcome! If you find any issues or want to suggest new features, feel free to open an issue or submit a pull request.

See our CONTRIBUTING.md for more details

License

This project is licensed under the Apache-2.0 license.


Elevate your Wirespec development workflow with the wirespec npm library.

版本与发布记录

@flock/wirespec 共发布 276 个版本,首次发布于 2023/07/31;过去 12 个月发布了 66 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.23.7latest2026/11/133 天前
0.23.62026/11/124 天前
0.23.52026/11/105 天前
0.23.42026/11/105 天前
0.23.32026/11/106 天前
0.23.22026/11/106 天前

其他发布通道:rc → 0.20.0-RC.16。

关于 @flock/wirespec 的常见问题

@flock/wirespec 是什么?

Simplify your API development workflows, accelerate implementation, and guarantee strict adherence to defined contract specifications

如何安装 @flock/wirespec?

在项目目录运行 npm install @flock/wirespec,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 wirespec、wirespec-lsp,可以用 npx wirespec 直接运行。

@flock/wirespec 支持 TypeScript 吗?

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

@flock/wirespec 支持 ESM 还是 CommonJS?

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

@flock/wirespec 可以商用吗?

@flock/wirespec 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@flock/wirespec 的下载量有多少?

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

@flock/wirespec 还在维护吗?

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