https://github.com/anshsinghsonkhia/smart-boolean
Convert various values to booleans and check if they are boolean-like.
https://github.com/anshsinghsonkhia/smart-boolean
Last synced: 5 months ago
JSON representation
Convert various values to booleans and check if they are boolean-like.
- Host: GitHub
- URL: https://github.com/anshsinghsonkhia/smart-boolean
- Owner: AnshSinghSonkhia
- License: apache-2.0
- Created: 2025-04-05T19:14:02.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-04-05T19:36:27.000Z (6 months ago)
- Last Synced: 2025-04-05T19:41:23.881Z (6 months ago)
- Language: TypeScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# smart-boolean
Convert various values to booleans and check if they are boolean-like.
[](https://www.npmjs.com/package/smart-boolean) [](LICENSE)
# Installation
Install the package using npm:
```bash
npm i smart-boolean
```Or with yarn:
```bash
yarn add smart-boolean
```# Usage
```js
const { boolean, isBooleanable } = require('smart-boolean');console.log(boolean('yes')); // true
console.log(boolean('maybe')); // false
console.log(isBooleanable('false')); // true
console.log(isBooleanable('123')); // false
```