New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

json-key-validate

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-key-validate

Validates required fields exists in the JSON

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

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 :star: if you like our work :heart:

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 :raised_hands:

Keywords

validate

FAQs

Package last updated on 13 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts