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

nv-id-info-local-db

v1.0.2

Published

nv-id-info-local-db ======================= - for small scale data (count < 1024 X 1024) local-storage

Downloads

156

Readme

nv-id-info-local-db

  • for small scale data (count < 1024 X 1024) local-storage

install

  • npm install nv-id-info-local-db

usage

  const x   = require("nv-id-info-local-db");

example

		var db = x.creat_db("./TEST",1024,64);
		/*
		> db
		DB {
		  meta: {
			real_cnt: 1025,
			max_cnt: 1024,
			each_group_cnt: 64,
			groups: [
			  [Array], [Array], [Array],
			  [Array], [Array], [Array],
			  [Array], [Array], [Array],
			  [Array], [Array], [Array],
			  [Array], [Array], [Array],
			  [Array]
			]
		  },
		  pathd: {
			workdir: '/home/cu-lib/nv-id-info-local-db/TEST',
			meta: '/home/cu-lib/nv-id-info-local-db/TEST/___meta___.json',
			zero: '/home/cu-lib/nv-id-info-local-db/TEST/0.v8ser',
			groups: [
			  '/home/cu-lib/nv-id-info-local-db/TEST/g0',
			  '/home/cu-lib/nv-id-info-local-db/TEST/g1',
			  '/home/cu-lib/nv-id-info-local-db/TEST/g2',
			  '/home/cu-lib/nv-id-info-local-db/TEST/g3',
			  '/home/cu-lib/nv-id-info-local-db/TEST/g4',
			  '/home/cu-lib/nv-id-info-local-db/TEST/g5',
			  '/home/cu-lib/nv-id-info-local-db/TEST/g6',
			  '/home/cu-lib/nv-id-info-local-db/TEST/g7',
			  '/home/cu-lib/nv-id-info-local-db/TEST/g8',
			  '/home/cu-lib/nv-id-info-local-db/TEST/g9',
			  '/home/cu-lib/nv-id-info-local-db/TEST/g10',
			  '/home/cu-lib/nv-id-info-local-db/TEST/g11',
			  '/home/cu-lib/nv-id-info-local-db/TEST/g12',
			  '/home/cu-lib/nv-id-info-local-db/TEST/g13',
			  '/home/cu-lib/nv-id-info-local-db/TEST/g14',
			  '/home/cu-lib/nv-id-info-local-db/TEST/g15'
			]
		  },
		  memd: {
			'0': {},
			'1': {},
			'2': {},
			'3': {},
			'4': {},
			'5': {},
			'6': {},
			'7': {},
			'8': {},
			'9': {},
			'10': {},
			'11': {},
			'12': {},
			'13': {},
			'14': {},
			'15': {},
			___zero___: { id: 0, f64passwd: 0, data: null }
		  },
		  cursor: 1,
		  flags: [
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0,
			... 925 more items
		  ]
		}
		*/


		var [id,hint] = db.inst_one(new Set([11,22,"sss"]))

		/*
		> id
		1
		> hint
		1713774482623.2795
		> 
		*/

		> db.get_one(id,hint)
		{
		  id: 1,
		  f64passwd: 1713774781353.7732,
		  data: Set(3) { 11, 22, 'sss' }
		}

		> db.updt_one(id,hint,new Error("err-as-data"))
		true
		> db.get_one(id,hint)
		{
		  id: 1,
		  f64passwd: 1713774781353.7732,
		  data: Error: err-as-data
			  at REPL35:1:21
			  at Script.runInThisContext (node:vm:122:12)
			  at REPLServer.defaultEval (node:repl:570:29)
			  at bound (node:domain:433:15)
			  at REPLServer.runBound [as eval] (node:domain:444:12)
			  at REPLServer.onLine (node:repl:900:10)
			  at REPLServer.emit (node:events:523:35)
			  at REPLServer.emit (node:domain:489:12)
			  at [_onLine] [as _onLine] (node:internal/readline/interface:415:12)
			  at [_line] [as _line] (node:internal/readline/interface:886:18)
		}
		> 
		db.dele_one(id,hint)
		> db.has(id,hint)
		false
		> 


		var [id,hint] = db.inst_one(new Set([11,22,"sss"]))
		var [id,hint] = db.inst_one(new Map())
		var [id,hint] = db.inst_one(new Uint8Array(8))
		var [id,hint] = db.inst_one("qqq")


		> db.slct((id,hint,data)=>typeof(data)=="string")
		[ { id: 4, f64passwd: 1713777224232.4827, data: 'qqq' } ]

METHODS

	db._save                 db.aloc                  db.constructor           db.dele_one              db.get_one               db.gid                   db.gpath                 db.has
	db.has_f64passwd         db.has_id                db.inst_one              db.slct                  db.updt_one              db.zero_

	db.cursor                db.flags                 db.memd                  db.meta                  db.pathd

APIS

  •        creat\_db(workdir, max\_count=1024768, chunk\_count=1024)    chunk\_count means how many data saved in one file

LICENSE

  • ISC