Skip to content

binghuis/nano-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A Nano Tool for Reading and Writing JSON.

Topics

Resources

License

Stars

Watchers

Forks