# @noobjsperson/edit-json

> A light weight package to edit your json files with ease

Latest version **2.5.0** (published 2021-06-27) · 0 weekly downloads

## Install

```sh
npm install @noobjsperson/edit-json
pnpm add @noobjsperson/edit-json
yarn add @noobjsperson/edit-json
bun add @noobjsperson/edit-json
```

## 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 | 2.5.0 |
| Published | 2021-06-27 |
| First published | 2021-05-09 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 17.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | noobjsperson |
| Keywords | json |

## Links

- npm: https://www.npmjs.com/package/@noobjsperson/edit-json
- Homepage: https://github.com/NoobJsPerson/edit-json#readme
- npm.io page: https://npm.io/package/@noobjsperson/edit-json

## 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

- 2.5.0 (latest) — 2021-06-27
- 2.4.7 — 2021-06-21
- 2.4.6 — 2021-06-21
- 2.4.5 — 2021-06-21
- 2.4.4 — 2021-06-21
- 2.4.3 — 2021-06-21
- 2.4.2 — 2021-06-21
- 2.4.1 — 2021-06-20
- 2.4.0 — 2021-06-16
- 2.3.2 — 2021-05-14
- 2.3.1 — 2021-05-13
- 2.3.0 — 2021-05-13
- 2.1.10 — 2021-05-11
- 2.1.9 — 2021-05-11
- 2.0.0 — 2021-05-10
- … 8 more at https://npm.io/package/@noobjsperson/edit-json/versions

## README

# edit-json
A small package to edit your json files with ease
# Documentation
Example:
```js
//defining the package
const edit = require('@noobjsperson/edit-json');
// creating an instance of EditClient with './storage.json' as the default file
const client = new edit('./storage.json');
// assign a value to a property in the default file
client.set('color','blue')
//result {"color":"blue"}
```
### `EditClient(file, dirname, relative)`

#### Params

- **String** `file`: the default directory of the file you want to edit
- **String** `dirname`: the directory that the client edits files relatively from
- **Boolean** `relative`: to specifying if the default directory should be relative to the location of the file that the function got called in

#### Returns

- **EditClient** The instance of the `EditClient` class

### `set(property, value, file, relative)`

#### Params

  * **String** `property`: the name of the property you to edit/create.
  * **String** `value`: the value assigned to the property it can be a number, string or another object
  * **String** `file`: the directory of the file you want to edit (if empty it'll edit the default file that got passed to the EditClient's constructor)
  * **Boolean** `relative`: a boolean specifying if the directory should be relative to the location of the file that the function got called in.
  
#### Returns
  
An empty promise.

### `delete(property, file, relative)`

#### Params

* **String** `property`: the name of the property you to delete.
* **String** `file`: the directory of the file you want to edit (if empty it'll edit the default file that got passed to the EditClient's constructor)
* **Boolean** `relative`: a boolean specifying if the directory should be relative to the location of the file that the function got called in.

#### Returns

An empty promise.

#### Disclaimer
this package is still under development consider contributing to it in the GitHub repository

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