# checkt

> Safe (chainable) type checks

Latest version **1.1.5** (published 2013-09-25) · Public domain license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install checkt
pnpm add checkt
yarn add checkt
bun add checkt
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.5 |
| Published | 2013-09-25 |
| First published | 2013-03-05 |
| Weekly downloads | 0 |
| License | Public domain |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Johannes Stein |
| Maintainers | stoney |
| Keywords | type, checks, chainable |

## Links

- npm: https://www.npmjs.com/package/checkt
- Repository: http://github.com/Stoney-FD/checkt
- Issues: https://github.com/Stoney-FD/checkt/issues
- npm.io page: https://npm.io/package/checkt

## Dependencies (1)

- [udefine](https://npm.io/package/udefine.md) ~0.8.2

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.1.5 (latest) — 2013-09-25
- 1.1.4 — 2013-09-17
- 1.1.3 — 2013-09-14
- 1.1.2 — 2013-09-02
- 1.1.1 — 2013-08-03
- 1.1.0 — 2013-07-28
- 1.0.0 — 2013-03-05

## README

checkt
======

[![Build Status](https://travis-ci.org/Stoney-FD/checkt.png?branch=master)](https://travis-ci.org/Stoney-FD/checkt)
[![Dependency Status](https://david-dm.org/Stoney-FD/checkt.png)](https://david-dm.org/Stoney-FD/checkt)
[![devDependency Status](https://david-dm.org/Stoney-FD/checkt/dev-status.png)](https://david-dm.org/Stoney-FD/checkt#info=devDependencies)

What is it?
-----------

__checkt__ is a small library for safe (chainable) type checks written in
CoffeeScript and usable in any JavaScript environment.

Currently supported are:

* Browser
* CommonJS environments (Node.js)

The checkt library exposes the checkt function. (An alias is the check object,
which has exactly the same functionality.)

__Browser__  
Embed `js/checkt.js` in your HTML file for development purposes and 
`js/checkt.min.js` for production use.

__Node.js__  
Either use npm with  
`npm install checkt`  
or add `checkt` to to the package.json of your project.

Usage
-----

__JavaScript__

```javascript
// Method chaining examples
check('test').not.string(function() {
 console.log('not a string');
}).otherwise(function() {
 console.log('Logically, should be a string');
}).number(function(v) {
 console.log("its a number with value: " + v);
});

// Instead of using method chaing, you can also use
// a plain object with the type as the key and the value is the callback function
check({}, {
  object: function() {
   console.log('Is an object');
  },
  number: function() {
   console.log('Is a number');
  }
});

// Multiple keys seperated by a comma also work, just make sure the key is
// written as a string
check('test', {
  'string, number': function() {
   console.log('Either string or number');
  }
});
```

__CoffeeScript__

```coffeescript
# Method chaining examples
check('test')
  .not.string(-> console.log 'not a string')
  .else(-> console.log 'Logically, should be a string')
  .number((v) -> console.log("its a number with value: #{v}"))

# Instead of using method chaing, you can also use
# a plain object with the type as the key and the value is the callback function
check {},
  object: -> console.log 'Is an object'
  number: -> console.log 'Is a number'

# Multiple keys seperated by a comma also work, just make sure the key is
# written as a string
check 'test',
  'string, number': -> console.log 'Either string or number'
```


License
-------

checkt is public domain. See __UNLICENSE.md__ for more information.

---
_Source: https://npm.io/package/checkt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
