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-array-listenable

v1.0.3

Published

nv-array-listenable =====================

Downloads

3

Readme

nv-array-listenable

  • nv-array-listenable is a very simple util to make a listenable Array

install

  • npm install nv-array-listenable

usage

const RArray = require("nv-array-listenable")

var arr = new RArray()

example

var arr = new RArray()

//listen for push method 
// e.data = {rslt:<the returned rets>,params:<the arguments>}
//          
arr.regis_$push$_handler(e=>{console.log(e,e.data)})

> arr.push(10)
E {
  type: 'push',
  defaultPrevented: false,
  cancelable: false,
  timeStamp: 49738.11588096619
} { params: [ 10 ], rslt: 1 }
1
>
> arr
ReactiveArray(1) [ 10 ]
>
> arr.push(10,20)
E {
  type: 'push',
  defaultPrevented: false,
  cancelable: false,
  timeStamp: 91699.88149785995
} { params: [ 10, 20 ], rslt: 3 }
3
> arr
ReactiveArray(3) [ 10, 10, 20 ]
>


//listen for set/get

arr.regis_$set_item$_handler(e=>{console.log(e,e.data)})

> arr.set_item(1,111)
E {
  type: 'set_item',
  defaultPrevented: false,
  cancelable: false,
  timeStamp: 42272.226580142975
} { params: [ 1, 111 ], rslt: 111 }
111
>
> arr
ReactiveArray(3) [ 10, 111, 20 ]
>

/*
    there are some bugs if modify Proxy,
    so the implement did NOT use Proxy,
    it just add two methods:
        get_item
        set_item
*/

METHODS

> arr.

arr.EVENTS                          arr.concat                          arr.constructor
arr.copyWithin                      arr.entries                         arr.et
arr.every                           arr.fill                            arr.filter
arr.find                            arr.findIndex                       arr.flat
arr.flatMap                         arr.forEach                         arr.includes
arr.indexOf                         arr.join                            arr.keys
arr.lastIndexOf                     arr.map                             arr.pop
arr.push                            arr.reduce                          arr.reduceRight

arr.regis_$concat$_handler          arr.regis_$copyWithin$_handler      arr.regis_$entries$_handler
arr.regis_$every$_handler           arr.regis_$fill$_handler            arr.regis_$filter$_handler
arr.regis_$find$_handler            arr.regis_$findIndex$_handler       arr.regis_$flat$_handler
arr.regis_$flatMap$_handler         arr.regis_$forEach$_handler         arr.regis_$includes$_handler
arr.regis_$indexOf$_handler         arr.regis_$join$_handler            arr.regis_$keys$_handler
arr.regis_$lastIndexOf$_handler     arr.regis_$map$_handler             arr.regis_$pop$_handler
arr.regis_$push$_handler            arr.regis_$reduce$_handler          arr.regis_$reduceRight$_handler
arr.regis_$reverse$_handler         arr.regis_$shift$_handler           arr.regis_$slice$_handler
arr.regis_$some$_handler            arr.regis_$sort$_handler            arr.regis_$splice$_handler
arr.regis_$toLocaleString$_handler  arr.regis_$toString$_handler        arr.regis_$unshift$_handler
arr.regis_$values$_handler          arr.reverse                         arr.rm_$concat$_handler
arr.rm_$copyWithin$_handler         arr.rm_$entries$_handler            arr.rm_$every$_handler
arr.rm_$fill$_handler               arr.rm_$filter$_handler             arr.rm_$find$_handler
arr.rm_$findIndex$_handler          arr.rm_$flat$_handler               arr.rm_$flatMap$_handler
arr.rm_$forEach$_handler            arr.rm_$includes$_handler           arr.rm_$indexOf$_handler
arr.rm_$join$_handler               arr.rm_$keys$_handler               arr.rm_$lastIndexOf$_handler
arr.rm_$map$_handler                arr.rm_$pop$_handler                arr.rm_$push$_handler
arr.rm_$reduce$_handler             arr.rm_$reduceRight$_handler        arr.rm_$reverse$_handler
arr.rm_$shift$_handler              arr.rm_$slice$_handler              arr.rm_$some$_handler
arr.rm_$sort$_handler               arr.rm_$splice$_handler             arr.rm_$toLocaleString$_handler
arr.rm_$toString$_handler           arr.rm_$unshift$_handler            arr.rm_$values$_handler



arr.shift                           arr.slice                           arr.some
arr.sort                            arr.splice                          arr.toLocaleString
arr.toString                        arr.unshift                         arr.values

arr.length

arr.set_item     arr.get_item

LICENSE

  • ISC