Skip to content

teuron/json-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON Validator

Simple JSON Validator through parameters for browser and Node.js.

Installation

Via npm on Node:

npm install json-parameter-parser

Usage

Reference in your program:

var validator = require('json-parameter-parser');

Parse a json

var valid = validator(json, ['parameter1', 'parameter2', 'parameter3.nested']);

If you want a wildcard search in a nested json just type:

var valid = validator(json, ['parameter1.*']);

You can also only test if one particular property is in a JSON.

var valid = validator(json, ['parameter']);

It is as simple as this. Returns true if the JSON has all the given Parameters, false if not.

Development

git clone git://github.com/teuron/json-validator.git
cd json-validator
npm install
npm test

License

MIT

Contribution

Feel free to file issues and submit pull requests contributions are welcome :)

If you submit a pull request, please be sure to add or update corresponding test cases, and ensure that npm test continues to pass.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published