npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

json-key-validate

1.0.2 • Public • Published

json-key-validate

Build Status Github Repo Size LICENSE NPM Downloads NPM Version Contributors Commit

Validates if all required keys are present in JSON object

Give us a ⭐️ if you like our work ❤️

Install

$ npm install json-key-validate --save

Usage

const jkValidate = require('json-key-validate');
 
const JSON_DATA = {
  'name': 'arr-contains',
  'author': 'Arshad Kazmi',
  'repository': {
    'url': 'https://github.com/arshadkazmi42/arr-contains',
    'language': 'js'
  }
};
 
const isValid = jkValidate(JSON_DATA, ['name', 'author']);
// Output -> true
 
const isValid = jkValidate(JSON_DATA, ['url', 'author']);
// Output -> false
 
const isValid = jkValidate('JSON_DATA', ['url', 'author']);
// Output -> false

Contributing

Interested in contributing to this project? You can log any issues or suggestion related to this library here

Read our contributing guide on getting started with contributing to the codebase

Contributors

Thank you to all the contributors who have helped us in making this project better 🙌

install

npm i json-key-validate

Downloadsweekly downloads

38

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability