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-facutil-cache-cursor

v1.0.5

Published

nv-facutil-cache-cursor =============== - simple cache with cursor - forward ,backword, push,pop, push\_and\_forward ,pop\_and\_backward

Downloads

13

Readme

nv-facutil-cache-cursor

  • simple cache with cursor
  • forward ,backword, push,pop, push_and_forward ,pop_and_backward

install

  • npm install nv-facutil-cache-cursor

usage

const Cache = require("nv-facutil-cache-cursor");      

example

    var cache = new Cache(4,null)                  // new Cache(max_size,noexist_sign)
    cache
    cache.cursor_

    /*

    > cache
    Cache(0) [ max_size: 4 ,noexist:null]
    > cache.cursor_
    -1
    */


    cache.push(10)
    cache.push(20)
    cache.push(30)
    cache.push(40)
    cache
    cache.cursor_


    /*
    > cache
    Cache(4) [ 10, 20, 30, 40, max_size: 4 ,noexist:null]
    > cache.cursor_
    -1
    */

    cache.forward(2)
    cache.cursor_
    cache.curr_

    /*
    > cache
    Cache(4) [ 10, 20, 30, 40, max_size: 4 ,noexist:null]
    > cache.forward(2)
    20
    > cache.cursor_
    1
    > cache.curr_
    20
    >

    */



    cache.push_and_forward(50)

    cache
    cache.cursor_
    cache.curr_

    /*
    > cache.push_and_forward(50)
    40
    >
    > cache
    Cache(4) [ 20, 30, 40, 50, max_size: 4 ,noexist:null]
    > cache.cursor_
    2
    > cache.curr_
    40
    >

    */


    cache.pop_and_backward()
    cache
    cache.cursor_
    cache.curr_

    /*
    cache.pop_and_backward()
    30
    > cache
    Cache(3) [ 20, 30, 40, max_size: 4 ,noexist:null]
    > cache.cursor_
    1
    > cache.curr_
    30
    >

    */



    cache.prev_
    cache.pprev_
    cache.next_
    cache.nnext_




    /*

    > cache.curr_
    30
    > cache.prev_
    20
    > cache.pprev_
    null
    > cache.next_
    40
    > cache.nnext_
    null

    */

SLICE

    > c = new C(4)
    Cache(0) [ max_size: 4, noexist: undefined ]
    >
    > c.push(10)
    > c.push(20)
    > c.push(30)
    > c.push(40)
    > c.forward()
    10
    > c.forward()
    20
    > c
    Cache(4) [ 10, 20, 30, 40, max_size: 4, noexist: undefined ]
    >
    > c.cursor_
    1
    > c.slice_lt_cursor_
    Cache(1) [ 10, max_size: 1, noexist: undefined ]
    >
    > c.slice_le_cursor_
    Cache(2) [ 10, 20, max_size: 2, noexist: undefined ]
    >
    > c.slice_gt_cursor_
    Cache(2) [ 30, 40, max_size: 2, noexist: undefined ]
    >
    > c.slice_ge_cursor_
    Cache(3) [ 20, 30, 40, max_size: 3, noexist: undefined ]
    >

METHODS

    cache.b                       cache.backward                cache.can_back_max_steps_
    cache.can_forward_max_steps_  cache.clear                   cache.constructor
    cache.curr_                   cache.f                       cache.forward
    cache.fst_                    cache.is_cant_backward_one    cache.is_cant_forward_one
    cache.is_empty                cache.is_pc_at_max            cache.is_pc_at_min
    cache.lst_                    cache.max_pc_                 cache.min_pc_
    cache.next_                   cache.nnext_                  cache.pc_
    cache.pop                     cache.pop_and_backward        cache.pprev_
    cache.prev_                   cache.push                    cache.push_and_forward
    cache.safe_pop

    c.slice_ge_cursor_        
    c.slice_gt_cursor_        
    c.slice_le_cursor_        
    c.slice_lt_cursor_


    cache.length                  cache.max_size

APIS

LICENSE

  • ISC