# json-disect

> An npm module to perform all kinds of operations like key extract, value extract,sorting based on keys/values,etc.

Latest version **1.0.4** (published 2019-04-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install json-disect
pnpm add json-disect
yarn add json-disect
bun add json-disect
```

## 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.4 |
| Published | 2019-04-03 |
| First published | 2019-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Saptarshi Dey |
| Maintainers | saptadey |
| Keywords | json, modify, key-extract, value-extract, sorting |

## Links

- npm: https://www.npmjs.com/package/json-disect
- Repository: https://github.com/sapta94/json-disect
- Homepage: https://github.com/sapta94/json-disect#readme
- Issues: https://github.com/sapta94/json-disect/issues
- npm.io page: https://npm.io/package/json-disect

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.4 (latest) — 2019-04-03
- 1.0.3 — 2019-04-03
- 1.0.2 — 2019-04-01
- 1.0.1 — 2019-03-27
- 1.0.0 — 2019-03-27

## README

# json-disect
An npm module to perform all kinds of operations like key extract, value extract,sorting based on keys/values,etc.

## Installations:
npm install json-disect


## Funtions

### getKeyString(str):
Paramter str is a valid JSON string <br>
returns a string with each key in JSON object separated by a comma

### getObjectString(str):
Paramter str is a valid JSON string <br>
returns a string with each value of each key in JSON object separated by a comma

### getObjectArray(str):
Paramter str is a valid JSON string <br>
returns an array with each key in JSON object

### sortOnKey(data,key,type):
Paramter data is a valid JSON array <br>
Paramter key is the key-name for based on which the elements of the data array is sorted <br>
Parameter type = 0 for sorting in ascending order and type=1 for descending order <br>
returns a sorted (ascending/descending) based on the above parameters

## Example

`var jsDisect = require('json-disect')` <br>
`var obj={
            name:'sapta',
            age:23,
            email:'dey7.kol@gmail.com'
        }`
`console.log(jsDisect.getKeyString(JSON.stringify(obj)))`
`console.log(jsDisect.getObjectString(JSON.stringify(obj)))`
`console.log(jsDisect.getObjectArray(JSON.stringify(obj)))`
`console.log(jsDisect.sortOnKey(obj,'age'))`

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