@bit2byte/nano-json
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

nano-json

A Nano Tool for Reading and Writing JSON.

node npm version

install

pnpm i @bit2byte/nano-json

usage

import path from "path";
import { PackageJson } from "type-fest";
import NanoJson from "@bit2byte/nano-json";

const pkg = new NanoJson<PackageJson>(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

Readme

Keywords

Package Sidebar

Install

npm i @bit2byte/nano-json

Weekly Downloads

2

Version

0.1.1

License

MIT

Unpacked Size

4.14 kB

Total Files

7

Last publish

Collaborators

  • bit2byte