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 is-present with all npm packages installed. Try it out:

var isPresent = require("is-present")

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

is-present v1.0.0

Check whether a value is nonblank.

is-present Build Status

Check whether a value is nonblank.


npm i --save is-present


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 ');       // => false

isPresent(['a', 'b']);      // => true
isPresent({ a: 'b' });      // => true
isPresent('string');        // => true
isPresent(42);              // => true
isPresent(function(a,b){}); // => true


A negation for is-blank which extends is-empty and is-whitespace.




  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 (@4lpine).

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