ow
TypeScript library for runtime validation of function arguments, with chainable predicates and readable error messages.
sindresorhus.com/ow/repositorydocs
ow checks the arguments of a function at runtime and throws an ArgumentError with a message when a value does not match. Checks are written as chained predicates, such as ow.string.minLength, and TypeScript type guards narrow the checked value afterwards.
The package installs from npm and runs in Node.js, where the name of a checked value is inferred from the source. In the browser that inference does not work.
Worth knowing
For complex schema validation, such as API responses or parsed JSON, the README points to zod instead. A dev-only import, ow/dev-only, exports a shim in production builds, which lowers the bundle size.
Identity
- Status
- Active
- Maintainer
- Sindre Sorhus3
- Maintained by
- Individual
- First release
- 20166
Rendering and deploy
- Install with
- npm2
Releases
Adoption
Sources
- 2026-11-16: links, Written in, License, GitHub stars
api.github.com/repos/sindresorhus/ow - 2026-11-16: links, Categories, Runtime, Install with
raw.githubusercontent.com/sindresorhus/ow/main/readme.md - 2026-11-16: Maintainer, License model
raw.githubusercontent.com/sindresorhus/ow/main/license - 2026-11-16: Minimum runtime
raw.githubusercontent.com/sindresorhus/ow/v3.1.1/package.json - 2026-11-16: Current major version, Last release
api.github.com/repos/sindresorhus/ow/releases/latest - 2026-11-16: First release
registry.npmjs.org/ow - 2026-11-16: Contributors
api.github.com/repos/sindresorhus/ow/contributors?per_page=1 - 2026-11-16: npm downloads a week
api.npmjs.org/downloads/range/2026-11-01:2026-11-07/ow - 2026-11-16: Dependent packages, Dependent repositories
packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/ow