Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including @bret/truthy with all npm packages installed. Try it out:

var truthy = require("@bret/truthy")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@bret/truthy v1.0.1

Determines if something should be considered a synonym for true

truthy

npm travis coverage

Determines if something should be considered a synonym for true.

A modularized version of the truthy function found in Functional Javascript by Michael Fogus.

Install

$ npm i @bret/truthy --save

Usage

var truthy = require('@bret/truthy')
truthy(false) // false
truthy(undefined) // false
truthy(0) // true
truthy('') // true

Contributing

Contributions welcome! Please read the contributing guidelines first.

Related

References

License

ISC

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free