# json-duplicate-key-handle

> A json handler that has an option to check for duplicated keys

Latest version **1.0.0** (published 2017-10-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install json-duplicate-key-handle
pnpm add json-duplicate-key-handle
yarn add json-duplicate-key-handle
bun add json-duplicate-key-handle
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-10-11 |
| First published | 2017-10-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | trinh.nck |
| Maintainers | trinh.nck |
| Keywords | jsonhandler, json, handle, duplicate |

## Links

- npm: https://www.npmjs.com/package/json-duplicate-key-handle
- Repository: https://github.com/KhanhTrinh2094/json-duplicate-key-handle
- Homepage: https://github.com/KhanhTrinh2094/json-duplicate-key-handl
- Issues: https://github.com/KhanhTrinh2094/json-duplicate-key-handle/issues
- npm.io page: https://npm.io/package/json-duplicate-key-handle

## Dependencies (1)

- [backslash](https://npm.io/package/backslash.md) ^0.2.0

## Recent versions

- 1.0.0 (latest) — 2017-10-11

## README

# json-dup-key-validator [![NPM version](https://img.shields.io/npm/v/json-duplicate-key-handle.svg)](https://www.npmjs.com/package/json-duplicate-key-handle) [![Build Status](https://travis-ci.org/jackyjieliu/json-duplicate-key-handle.svg?branch=master)](https://travis-ci.org/jackyjieliu/json-duplicate-key-handle)

A json handler that has an option to check for duplicated keys

## Install
`npm install json-duplicate-key-handle`
## Usage
```js
var jsonHandler = require('json-duplicate-key-handle');

// Returns error or undefined if json is valid
jsonHandler.validate(jsonString, allowDuplicatedKeys);

// Returns the object and handle if duplicate key
jsonHandler.parse(jsonString, allowDuplicatedKeys);
```
## API
## .validate(jsonString, allowDuplicatedKeys)
Validates a json string and returns error if any, undefined if the json string is valid.
#### jsonString
Type: `String`

JSON string to parse
#### allowDuplicatedKeys
Type: `Boolean`

Default: `false`

Whether duplicated keys are allowed in an object or not

## .parse(jsonString, allowDuplicatedKeys)
Parses a json string and returns the parsed result
#### jsonString
Type: `String`

JSON string to parse
#### allowDuplicatedKeys
Type: `Boolean`

Default: `false`

Whether duplicated keys are allowed in an object or not

---
_Source: https://npm.io/package/json-duplicate-key-handle · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
