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 🙏

© 2025 – Pkg Stats / Ryan Hefner

nv-facutil-simple-db

v1.0.1

Published

nv-facutil-simple-db ======================== - just a array of fixed size(default 1000000) - insert-method on array - delete /update /left-pend right-pend/ commit/ rollback on element - suitable for 10w ~ 20w small in-memory datas(just saved in a array)

Downloads

2

Readme

nv-facutil-simple-db

  • just a array of fixed size(default 1000000)
  • insert-method on array
  • delete /update /left-pend right-pend/ commit/ rollback on element
  • suitable for 10w ~ 20w small in-memory datas(just saved in a array)

install

  • npm install nv-facutil-simple-db

usage

    const {creat_db,ERRORS} = require("nv-facutil-simple-db")  

example

        var db = creat_db(1000000);

        var data = db.insert_and_commit([1,2])
        /*
        > data
        Data(7) [2 %VbWFgVDA:2% ] [
          Forest {
            fid: 'VbWFgVDALYLhKTDjKZbFeTfaXvoDLkezRSFp',
            max_size: 1000001,
            idpool: { minid_: 1, maxid_: 1000001, used_: 2, lefted_: 999999 }
          },
          2,
          false,
          4,
          Symbol(empty),
          [ 1, 2 ],
          Symbol(empty)
        ]
        >
        */
        data.curr_;
        /*
        > data.curr_;
        [ 1, 2 ]
        >
        */

        data.update_and_commit({k:"value"})
        /*
        > data.prev_
        [ 1, 2 ]
        > data.curr_
        { k: 'value' }
        >
        */

        var data2 = data.rpend("string")
        /*
        > data2
        Data(7) [3 %VbWFgVDA:3% ] [
          Forest {
            fid: 'VbWFgVDALYLhKTDjKZbFeTfaXvoDLkezRSFp',
            max_size: 1000001,
            idpool: { minid_: 1, maxid_: 1000001, used_: 3, lefted_: 999998 }
          },
          3,
          false,
          1,
          Symbol(empty),
          Symbol(empty),
          'string'
        ]
        >
        > data2.is_pending()
        true
        >
        > data2.commit()
        > data2.is_pending()
        false
        > data2.curr_
        'string'
        > data2.is_new_stable()
        true
        > data2.is_stable()
        true
        >
        > data2
        Data(7) [3 %VbWFgVDA:3% ] [
          Forest {
            fid: 'VbWFgVDALYLhKTDjKZbFeTfaXvoDLkezRSFp',
            max_size: 1000001,
            idpool: { minid_: 1, maxid_: 1000001, used_: 3, lefted_: 999998 }
          },
          3,
          false,
          4,
          Symbol(empty),
          'string',
          Symbol(empty)
        ]
        >


        */


        db.search((prev,curr,next)=>typeof(curr)==='string')

        /*
        [
            Data(7) [3 %VbWFgVDA:3% ] [
              Forest {
                fid: 'VbWFgVDALYLhKTDjKZbFeTfaXvoDLkezRSFp',
                max_size: 1000001,
                idpool: { minid_: 1, maxid_: 1000001, used_: 3, lefted_: 999998 }
              },
              3,
              false,
              1,
              Symbol(empty),
              Symbol(empty),
              'string'
            ]
        ]
        */

dump

    var v8_dumped = db.slow_dump()
    /*
        {
          fid: 'LGKweecBeNjtfAFlrVbaXUwpadGMeYSaJpHJ',
          maxid: 1000001,
          struct: {
            ids: [ 1, 2, 3 ],
            fc: [ 2, 0, 0 ],
            pr: [ 0, 1, 1 ],
            rb: [ 0, 3, 0 ],
            lb: [ 0, 0, 2 ],
            lc: [ 3, 0, 0 ]
          },
          data: [
            null,
            'ÿ\rA\x03I\nA\x02I\x02I\x04$\x00\x02o"\x01k"\x05value{\x01$\x00\x03',
            'ÿ\rA\x02I\b"\x06string$\x00\x02'
          ]
        }

    */

    var jdumped = db.fast_dump()
    /*
        {
          fid: 'LGKweecBeNjtfAFlrVbaXUwpadGMeYSaJpHJ',
          maxid: 1000001,
          struct: {
            ids: [ 1, 2, 3 ],
            fc: [ 2, 0, 0 ],
            pr: [ 0, 1, 1 ],
            rb: [ 0, 3, 0 ],
            lb: [ 0, 0, 2 ],
            lc: [ 3, 0, 0 ]
          },
          data: [ null, [ 5, [Array], [Object] ], [ 4, 'string' ] ]
        }

    */

load

var db_x = load_from_slow_dumped(v8_dumped);
var db_y = load_from_fast_dumped(jdumped)

APIS

  • creat_db(max_size=1000000) -> DbRoot
  • load_from_slow_dumped(v8j) -> DbRoot
  • load_from_fast_dumped(jj) -> DbRoot
  • load_from_slow_file(fn) -> DbRoot
  • load_from_fast_file(fn) -> DbRoot

METHODS

db

    db.capacity_                               
    db.insert                                  db.insert_and_commit
    db.search                                  db.size_

    db.fast_dump()   //only support data-which-can-be-json.stringified
    db.slow_dump()   //support data-can-be-structure-cloned 

    db.fast_dump_to_file(file_name);
    db.slow_dump_to_file(file_name);
    
     

data

        data.commit
        data.curr_                                   data.delete
        data.delete_and_commit                       data.is_curr_empty
        data.is_deleting                             data.is_init
        data.is_new_stable                           data.is_next_empty
        data.is_pending                              data.is_prev_empty
        data.is_stable                               data.is_updating
        data.lpend                                   data.lpend_and_commit
        data.next_                                   data.prev_
        data.rollback                                data.rpend
        data.rpend_and_commit                        data.search
        data.search_aft_self                         data.search_bfr_self
        data.state_                                  data.update
        data.update_and_commit

LICENSE

  • ISC