npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

expert-json

v1.0.3

Published

Easy Crud Json Db

Downloads

13

Readme

Dependency

npm i expert-json

KETERANGAN.

  • Expert Json adalah Librari basis nodejs di peruntukkan untuk Crud query Database dalam bentuk JSON file
  • perintah di desain hampir sama dengan query ke MYSQL hingga mempermudah kita
  • untuk mengelolah data JSON apabila terbiasa dengan query MYSQL

CARA PAKAI

  • INISIASI CRUD
const {Expert} = require('expert-json');
const go = new Expert("./db/log.json");
  • GET ALL DATA ASYNC
await go.get();
  • GET DATA PARSING ASYNC [where,limit,LIKE]
await go.get(["status",true],1,"search value");
  • WHERE use after await go.get();
go.where(["status",true]);
go.where(["status","=",true]);
go.where(["status","!=",true]);
go.where(["num",">",100]);
go.where(["num",">=",100]);
go.where(["num","<",100]);
go.where(["num","<=",100]);
  • LIMIT use after await go.get();
go.limit(10);
  • ORDERBY use after await go.get();
go.orderBy("id","DESC");
  • OFFSET use after await go.get(); // var limit = 10; // var page = 1; // var index = (page-1)*limit;
go.offset(index,limit);
  • LIKE / REGEX use after await go.get();
go.regex("search value");

ASYNC FUNCTION CRUD

  • FIND
await go.find({id:1});
  • FIND-ONE
await go.findOne({id:1});
  • INSERT
await go.insert({id:1,name:"ismail samudra"});
  • UPDATE
await go.update({id:1},{name:"Ubaid Fawaz Fatih"});
  • REMOVE / DELETE
await go.remove({id:1});

OTHER FUNCTION

  • INISIASI
Use const {Expert,ExpertDb,xFile,dFile,isNum} = require('expert-json');
  • CREATE FILE DB JSON
ExpertDb("dir/jsonName");
  • CREATE FILE OR DIR dinamis link

ONLY DIR

xFile("./dir1/dir2");

DINAMIS FILE

xFile("./dir1/dir2/log.txt");
  • DELETE FILE OR DIR dinamis link
dFile("./dir1/dir2/log.txt");
  • CEK STRING IS NUMBER OR NOT output : true/false
var cek = isNum("123");

RANDOM ID

  • INISIASI
Use const {Expert,ExpertDb,xFile,dFile,isNum,randomId} = require('expert-json');
  • CODE : number = only number A__ = only Huruf Besar a__ = only Huruf kecil Aa_ = Huruf Besar & huruf kecil An_ = Huruf Besar & number an_ = Huruf kecil & number Aan = Huruf Besar , huruf kecil & number

  • RELASI [ CODE ],[ Length (jumlah huruf) ]

  • CODE USE

var id = randomId("Aan",8);
  • EXAMPLE OUTPUT RANDOM ID "// GHysx6r7"

EXAMPLE CODE GET DATA

const {Expert} = require('expert-json');
const go = new Expert("./db/log.json");
async function getData(){
   var limit = 5;
   var page = 1;
   var index = (page-1)*limit;
   await go.get();
   go.orderBy("id","DESC");
   return go.offset(index,limit);
}

EXAMPLE CODE INSERT DATA

const {Expert} = require('expert-json');
const go = new Expert("./db/log.json");
// var document = {name:"Ismail Samudra",level:"develope"};
async function insert(document){
   return await go.insert(document);
}

BY : ISMAIL SAMUDRA DONASI : SAWERIA