https://github.com/binghuis/nano-json
A Nano Tool for Reading and Writing JSON.
https://github.com/binghuis/nano-json
json read write
Last synced: 4 months ago
JSON representation
A Nano Tool for Reading and Writing JSON.
- Host: GitHub
- URL: https://github.com/binghuis/nano-json
- Owner: binghuis
- License: mit
- Created: 2024-04-24T08:02:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-24T10:26:07.000Z (over 1 year ago)
- Last Synced: 2025-03-21T19:30:02.872Z (7 months ago)
- Topics: json, read, write
- Language: TypeScript
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nano-json
A Nano Tool for `Reading` and `Writing` JSON.

[](https://www.npmjs.com/package/@bit2byte/nano-json)## install
`pnpm i @bit2byte/nano-json`
## usage
```ts
import path from "path";
import { PackageJson } from "type-fest";
import NanoJson from "@bit2byte/nano-json";const pkg = new NanoJson(path.join(__dirname, "./package.json"));
// read
await pkg.r();if (pkg.d) {
// edit
pkg.d.version = "1.0.0";
}// write
await pkg.w();
```Inspired by [@srzorro/file-json](https://github.com/SrZorro/file-json)