https://github.com/bcomnes/truthy
Determines if something should be considered a synonym for true
https://github.com/bcomnes/truthy
Last synced: 9 months ago
JSON representation
Determines if something should be considered a synonym for true
- Host: GitHub
- URL: https://github.com/bcomnes/truthy
- Owner: bcomnes
- License: isc
- Created: 2015-11-16T04:51:59.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-05-25T04:10:25.000Z (about 6 years ago)
- Last Synced: 2025-09-29T15:41:20.669Z (9 months ago)
- Language: JavaScript
- Homepage: https://npmjs.com/package/@bret/truthy
- Size: 23.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# truthy
[![npm][npm-image]][npm-url]
[![travis][travis-image]][travis-url]
[![coverage][coverage-image]][coverage-url]
[npm-image]: https://img.shields.io/npm/v/@bret/truthy.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/@bret/truthy
[travis-image]: https://img.shields.io/travis/bcomnes/truthy.svg?style=flat-square
[travis-url]: https://travis-ci.org/bcomnes/truthy
[coverage-image]: https://img.shields.io/codeclimate/coverage/github/bcomnes/truthy.svg?style=flat-square
[coverage-url]: https://codeclimate.com/github/bcomnes/truthy
Determines if something should be considered a synonym for `true`.
A modularized version of the `truthy` function found in [*Functional Javascript*](http://shop.oreilly.com/product/0636920028857.do) by [Michael Fogus](http://blog.fogus.me/).
## Install
```
$ npm i @bret/truthy --save
```
## Usage
```js
var truthy = require('@bret/truthy')
truthy(false) // false
truthy(undefined) // false
truthy(0) // true
truthy('') // true
```
## Contributing
Contributions welcome! Please read the [contributing guidelines](CONTRIBUTING.md) first.
## Related
- [`existy`](https://www.npmjs.com/package/existy)
## References
- [*Functional Javascript*](http://shop.oreilly.com/product/0636920028857.do) by [Michael Fogus](http://blog.fogus.me/)
- ["this is my best module"](https://twitter.com/substack/status/469024887949242368) - substack
## License
[ISC](LICENSE)