@condenast/flyway-schema-validator

中文文档
12.14.2发布于 2025/10/14MITCommonJS近 30 天下载 2084

A joi schema validator for flyways types

原始使用文档
文档目录5 节
  1. Installation
  2. Example Javascript Usage
  3. Example Command Line Usage
  4. Publishing Updates
  5. License

Flyway schema validator

Does what it says on the tin.

See https://condenast.github.io/flyway-api-docs/.

Installation

To use as a node.js module, make sure you're in your project source and run:

npm i --save @condenast/flyway-schema-validator

To use as a command line module, install globally with the following command:

npm i -g @condenast/flyway-schema-validator

Example Javascript Usage

const validator = require('@condenast/flyway-schema-validator');

const isValid = validator(someFlywayAPIObject);

try {
  // invalid
  const invalidThrows = validator({ invalid: true });
} catch (err) {
  // error describes the validation issues.
}

Example Command Line Usage

*nix Piping:

cat someObj.json | flyway-schema-validator

Reading from a file directly:

flyway-schema-validator -f ./someObj.json

Publishing Updates

To publish updates, you must bump the version number using npm version major|minor|patch, and push the generated commit and tag to github.

CI will detect a new tag push and automatically build and publish it.

Generally the workflow after merging a PR should be

git checkout master
git pull
npm version patch|minor|major|v11.x.x # <--- this also generates a git commit and tags it based on the new version
git push origin master # push that commit to master
git push origin --tags

CI will now pickup and build your changes.

NOTE: we use a new branch that tracks origin master so if you have accidentally commited to master locally, that doesn't get published without any PR. If you're confident that your master matches origin EXACTLY feel free to do this on your local master branch.

License

MIT.

版本与发布记录

@condenast/flyway-schema-validator 共发布 176 个版本,首次发布于 2017/12/04;过去 12 个月发布了 0 个版本。

版本发布日期距今
12.14.2latest2025/10/141.1 年前
12.14.12025/09/231.1 年前
12.14.02025/09/181.2 年前
12.13.02025/09/021.2 年前
12.11.02025/08/041.3 年前
12.10.02024/03/042 年前

其他发布通道:beta → 10.5.0-beta.0。

关于 @condenast/flyway-schema-validator 的常见问题

@condenast/flyway-schema-validator 是什么?

A joi schema validator for flyways types

如何安装 @condenast/flyway-schema-validator?

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

@condenast/flyway-schema-validator 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/condenast__flyway-schema-validator 是否存在。

@condenast/flyway-schema-validator 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@condenast/flyway-schema-validator 可以商用吗?

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

@condenast/flyway-schema-validator 的下载量有多少?

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

@condenast/flyway-schema-validator 还在维护吗?

最新版本 12.14.2 发布于 2025/10/14(1.1 年前);至今共发布 176 个版本,其中过去 12 个月发布了 0 个;首次发布于 2017/12/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。