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 400,000 packages pre-installed, including should-check with all npm packages installed. Try it out:

var shouldCheck = require("should-check")

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

should-check v0.1.1

object check module using should.js


node.js object check module using should.js


You can check objects format (for example test cases..)


var check = require('should-check');

var obj = {
  Model: ['prop1'],
  List: [':[Model]'],
  ModelListObj: ['list:[Model]']

var sc = check.init(obj);

sc.check('Model', {prop1: 'val1'});
sc.check('List', [{prop1: 'val1'}]);
sc.check('ModelListObj', {list: [{prop1: 'val1'}]});

var json = sc.checkJSON('Model', '{"prop1": "val1"}');



initialize and return SC object

sc.check(name, target_obj)

compare target_obj and name of object

sc.checkJSON(name, json_str)

parse json_str and compare the json and name of object. Also return the parsed json object.


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