Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

node-are

imaginate7Apache-2.0deprecated0.3.2

Project moved to github.com/imaginate/vitals. Use npmjs.com/node-vitals vitals.is.

Simple JS Type Tests

imaginate, javascript type checking, js type checking, type checking, javascript type check, js type check, type check, javascript type, js type, type, are javascript, are-js, are js, arejs, are, is javascript, is-js, is js, isjs, is

readme

Project Moved!

are has been merged into vitals. Development will no longer occur on this repository. The old readme has been left below for historical reasons. Please direct all questions, issues, etc. to vitals.

are npm version

Simple JS Type Checks

are will make your JavaScript development better! It contains two libraries, is and are, that will cover all of your data, object, and state type check needs. Their simple and intuitive APIs will make your projects easier to read and maintain while sustaining high performance. Take a look at some examples below.

Examples

  • is `javascript // example string checks var val = 'a string'; is('string', val); is('str', val); is.string(val); is.str(val);

// other examples is('string|number', val); // is val a primitive string or number is('!arrays|regexps', val); // is val a non-null array of arrays or regexps is.document(val); // is val a DOM document instance is.directory(val); // is val a valid directory path (for node.js only)

- **_are_**
```javascript
// example string checks
var val1, val2, val3;
are('string', val1, val2, val3);
are('str', [ val1, val2, val3 ]);
are.string([ val1, val2, val3 ]);
are.str(val1, val2, val3);

// other examples
are('elem=', [ val1, val2, val3 ]); // is each val undefined, null, or a DOM element
are('?bool', val1, val2, val3); // is each val a boolean or null
are.empty(val1, val2, val3); // is each val empty (see docs for more info)
are.file([ val1, val2, val3 ]); // is each val a valid file path (for node.js only)

Install & Use

node.js

  • npm install node-are
  • require('node-are')(); // global.are and global.is now available or
  • var are = require('node-are').are; var is = require('node-are').is;

browser

amd

  • download are.min.js
  • require([ 'are' ], function(null) { ... })
  • window.is(...) && window.are(...) (appended to window)

API Documentation

Other Details

contributing: see contributing guideline
bugs/improvements: open an issue
questions: learn@algorithmiv.com

-- Happy Developing,

Algorithm IV Logo