Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johno/is-present
Check whether a value is present (nonblank).
https://github.com/johno/is-present
Last synced: 2 months ago
JSON representation
Check whether a value is present (nonblank).
- Host: GitHub
- URL: https://github.com/johno/is-present
- Owner: johno
- License: mit
- Created: 2014-12-11T23:34:19.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-09-30T21:12:27.000Z (over 9 years ago)
- Last Synced: 2024-10-19T17:30:51.672Z (3 months ago)
- Language: JavaScript
- Size: 145 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# is-present [![Build Status](https://travis-ci.org/johnotander/is-present.svg?branch=master)](https://travis-ci.org/johnotander/is-present)
Check whether a value is nonblank.
## Installation
```
npm i --save is-present
```## Usage
```javascript
var isPresent = require('is-present');isPresent([]); // => false
isPresent({}); // => false
isPresent(0); // => false
isPresent(function(){}); // => false
isPresent(null); // => false
isPresent(undefined); // => false
isPresent(''); // => false
isPresent(' '); // => false
isPresent('\r\t\n '); // => falseisPresent(['a', 'b']); // => true
isPresent({ a: 'b' }); // => true
isPresent('string'); // => true
isPresent(42); // => true
isPresent(function(a,b){}); // => true
```## Acknowledgements
A negation for [is-blank](https://github.com/johnotander/is-blank) which extends
[is-empty](https://github.com/ianstormtaylor/is-empty) and
[is-whitespace](https://github.com/jonschlinkert/is-whitespace).## 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 RequestCrafted with <3 by [John Otander](http://johnotander.com) ([@4lpine](https://twitter.com/4lpine)).