# boolean-type

> the boolean type object.

Latest version **0.1.1** (published 2016-02-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install boolean-type
pnpm add boolean-type
yarn add boolean-type
bun add boolean-type
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2016-02-28 |
| First published | 2015-10-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | riceball |
| Keywords | abstract-type, string, type, class, klass |

## Links

- npm: https://www.npmjs.com/package/boolean-type
- Repository: https://github.com/snowyu/boolean-type.js
- Issues: https://github.com/snowyu/boolean-type.js/issues
- npm.io page: https://npm.io/package/boolean-type

## Dependencies (3)

- [util-ex](https://npm.io/package/util-ex.md) ^0.3.15
- [inherits-ex](https://npm.io/package/inherits-ex.md) ^1.1.4
- [abstract-type](https://npm.io/package/abstract-type.md) ^0.4.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

- 0.1.1 (latest) — 2016-02-28
- 2.0.0-alpha.2 (alpha) — 2021-05-11
- 2.0.0-alpha.1 — 2021-05-11
- 2.0.0-alpha.0 — 2021-05-10
- 0.1.0 — 2015-10-01

## README

## boolean-type [![npm][npm-svg]][npm]

[![Build Status][travis-svg]][travis]
[![Code Climate][codeclimate-svg]][codeclimate]
[![Test Coverage][codeclimate-test-svg]][codeclimate-test]
[![downloads][npm-download-svg]][npm]
[![license][npm-license-svg]][npm]

[npm]: https://npmjs.org/package/boolean-type
[npm-svg]: https://img.shields.io/npm/v/boolean-type.svg
[npm-download-svg]: https://img.shields.io/npm/dm/boolean-type.svg
[npm-license-svg]: https://img.shields.io/npm/l/boolean-type.svg
[travis-svg]: https://img.shields.io/travis/snowyu/boolean-type.js/master.svg
[travis]: http://travis-ci.org/snowyu/boolean-type.js
[codeclimate-svg]: https://codeclimate.com/github/snowyu/boolean-type.js/badges/gpa.svg
[codeclimate]: https://codeclimate.com/github/snowyu/boolean-type.js
[codeclimate-test-svg]: https://codeclimate.com/github/snowyu/boolean-type.js/badges/coverage.svg
[codeclimate-test]: https://codeclimate.com/github/snowyu/boolean-type.js/coverage

The boolean type info object.

## Usage

```js
var BooleanType  = require('boolean-type')
var Bool = BooleanType({boolNames: {
  false: ['false', 'no', 'wrong']
  true:  ['true', 'yes', 'ok']
}})
var b = Bool.create('true')
//or b= Bool.create('yes')
//or b= Bool.create('ok')
console.log(String(b))
//=true
console.log(b.isValid())
//=true
console.log(s.toJson()))
//="true"
console.log(s.toJson({withType:true})))
//='{"value":"true","name":"Boolean","boolNames":{"false":["false","no","wrong"],"true":["true","yes","ok"]}}'
n.assign('w')
//=TypeError: "w" is an invalid Boolean
n.assign('wrong')
//n.valueOf()=false
```

## API

See [abstract-type](https://github.com/snowyu/abstract-type.js)

## TODO


## License

MIT

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