https://github.com/johno/is-blank
Check whether a value is empty or blank, includes string whitespace support.
https://github.com/johno/is-blank
Last synced: 3 months ago
JSON representation
Check whether a value is empty or blank, includes string whitespace support.
- Host: GitHub
- URL: https://github.com/johno/is-blank
- Owner: johno
- License: mit
- Created: 2014-12-06T19:15:09.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-02-24T01:33:53.000Z (over 9 years ago)
- Last Synced: 2026-03-20T20:56:58.766Z (4 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# is-blank [](https://travis-ci.org/johnotander/is-blank) [](https://github.com/feross/standard)
Check whether a value is empty or blank.
## Installation
```
npm i -S is-blank
```
## Usage
```js
const isBlank = require('is-blank')
isBlank([]) // => true
isBlank({}) // => true
isBlank(0) // => true
isBlank(function(){}) // => true
isBlank(null) // => true
isBlank(undefined) // => true
isBlank('') // => true
isBlank(' ') // => true
isBlank('\r\t\n ') // => true
isBlank(['a', 'b']) // => false
isBlank({ a: 'b' }) // => false
isBlank('string') // => false
isBlank(42) // => false
isBlank(function(a,b){}) // => false
```
## Related
- [is-empty](https://github.com/ianstormtaylor/is-empty)
- [is-whitespace](https://github.com/jonschlinkert/is-whitespace)
- [is-present](https://github.com/johnotander/is-present)
## License
MIT
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
Crafted with <3 by [John Otander](http://johnotander.com) ([@4lpine](https://twitter.com/4lpine)).
***
> This package was initially generated with [yeoman](http://yeoman.io) and the [p generator](https://github.com/johnotander/generator-p.git).