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

// This example is created to test Konstraints on tonicdev.com konstraints = require('konstraints'); var target, rules; target = { foo: { bar: 42 }, baz: { one: 1, two: 2 } }; rules = [ { $typeof: 'object' }, { $keys: [ 'foo', 'baz' ] }, { 'foo': { $keys: [ 'bar' ] } }, { 'foo.bar': [ { $eq: 42 }, { $lt: 44 } ] }, { 'baz': { $length: 2 } }, { 'baz.*': { $gt: 0 } } ]; konstraints(target, rules).results;

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

konstraints v0.1.6

Constraints checker for given object and rules along with it.

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