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 🙏

© 2026 – Pkg Stats / Ryan Hefner

nv-facutil-simple-pulse

v1.0.0

Published

nv-facutil-simple-pulse =======================

Downloads

5

Readme

nv-facutil-simple-pulse

  • simple promise product/consume/pulse

install

  • npm install nv-facutil-simple-pulse

usage

  const {creat_pulse} = require("nv-facutil-simple-pulse")


  creat_pulse: (executor:Executor,ctx:Object,copy:Copy):Pulse
        Excutor: (rtrn,self)=>{/*...*/}
        Copy:    (self)=>Object

  DFLT_COPY:
     (self) => {
         let ctx = {}
         Object.assign(ctx,self);
         return(ctx);
     }

example

    function tsk(rtrn,self) {
        console.log('begin:',new Date())
        setTimeout(
            ()=> {
                self.sum = self.sum +1;
                console.log(`increased`)
                rtrn();
                console.log('end:',new Date())
            },
            10000
        )
    }


    var P = creat_pulse(tsk,{sum:0})

single-product

    > P.product()
    begin: 2021-12-01T09:08:55.878Z
    Promise { <pending> }
    >
    > await P.consume()
    increased
    end: 2021-12-01T09:09:05.882Z
    Pulse { sum: 1 }
    >
    > P
    Pulse { sum: 1 }
    >

multi-product

    P.product()
    P.product()
    P.product()

    >     P.product()
    begin: 2021-12-01T09:48:55.944Z
    Promise { <pending> }
    >     P.product()
    Promise { <pending> }
    >     P.product()
    Promise { <pending> }
    >
    > increased
    begin: 2021-12-01T09:49:05.950Z
    end: 2021-12-01T09:49:05.951Z

    > increased
    begin: 2021-12-01T09:49:15.957Z
    end: 2021-12-01T09:49:15.958Z
    increased
    end: 2021-12-01T09:49:25.970Z

    > P
    Pulse { sum: 4 }
    > P.history_
    [ { sum: 2 }, { sum: 3 }, { sum: 4 } ]
    >
    > P.consume()
    { sum: 2 }
    > P.consume()
    { sum: 3 }
    > P.consume()
    { sum: 4 }
    > P.history_
    []
    >
    > P
    Pulse { sum: 4 }
    >

pulse consume-one(if exist) AND product

     await P.pulse()
     >
     begin: 2021-12-01T09:52:30.269Z
     increased
     end: 2021-12-01T09:52:40.281Z
     Pulse { sum: 5 }
     > P.history_
     []
     > P
     Pulse { sum: 5 }
     >
     P.pulse()
     P.pulse()
     P.pulse()

      > P.history_
      []
      > P.pending_
      Pending(3) [
        [ Promise { <pending> }, [Function (anonymous)] ],
        [ Promise { <pending> }, [Function (anonymous)] ],
        [ Promise { <pending> }, [Function (anonymous)] ]
      ]
      > increased
      begin: 2021-12-01T09:57:41.850Z
      end: 2021-12-01T09:57:41.851Z

      > P.history_
      []
      > increased
      begin: 2021-12-01T09:57:51.858Z
      end: 2021-12-01T09:57:51.859Z

      > P.history_increased
      end: 2021-12-01T09:58:01.868Z
      [ { sum: 7 }, { sum: 8 } ]
      > P.pending_
      Pending(0) []
      > P.history_
      [ { sum: 7 }, { sum: 8 } ]
      > P
      Pulse { sum: 8 }
      >

     > await P.pulse()
     begin: 2021-12-01T09:59:25.367Z
     { sum: 7 }
     >
     > P.pending_
     Pending(1) [ [ Promise { <pending> }, [Function (anonymous)] ] ]
     > P.history_
     [ { sum: 8 } ]
     > increased
     end: 2021-12-01T09:59:35.371Z

     > P.history_
     [ { sum: 8 }, { sum: 9 } ]
     >

       > await P.consume()
       { sum: 8 }
       > P.history_
       [ { sum: 9 } ]
       > await P.consume()
       { sum: 9 }
       > P.history_
       []
       > await P.pulse()
       begin: 2021-12-01T10:00:32.584Z
       increased
       end: 2021-12-01T10:00:42.585Z
       Pulse { sum: 10 }
       > await P.pulse()
       begin: 2021-12-01T10:00:42.595Z
       increased
       end: 2021-12-01T10:00:52.599Z
       Pulse { sum: 11 }
       >
       >
       > P
       Pulse { sum: 11 }
       >

    async function factory() {
        while(true) {
            await P.product()
        }
    }

     > factory()
     begin: 2021-12-01T10:03:19.817Z
     Promise { <pending> }
     >
     > P
     Pulse { sum: 11 }
     > P.history_
     []
     > increased
     end: 2021-12-01T10:03:29.821Z
     begin: 2021-12-01T10:03:29.823Z
     > P.history_
     [ { sum: 12 } ]
     > P.history_
     [ { sum: 12 } ]
     > increased
     end: 2021-12-01T10:03:39.831Z
     begin: 2021-12-01T10:03:39.832Z

     > P.history_
     [ { sum: 12 }, { sum: 13 } ]
     >
     > increased
     end: 2021-12-01T10:03:49.835Z
     begin: 2021-12-01T10:03:49.837Z

     > P.consuincreased
     end: 2021-12-01T10:03:59.841Z
     >
     > P.history_
     [ { sum: 12 }, { sum: 13 }, { sum: 14 }, { sum: 15 } ]
     >
     > P.consincreased
     end: 2021-12-01T10:04:09.847Z
     umein: 20me()
     { sum: 12 }
     > P.consume()
     { sum: 13 }
     > P.consume()
     { sum: 14 }
     > P.history_
     [ { sum: 15 }, { sum: 16 } ]
     > P.history_increased
     end: 2021-12-01T10:04:19.853Z
     > P.consume()          // if history has result will return rslt
     { sum: 15 }
     > P.consume()
     { sum: 16 }
     > P.consume()
     { sum: 17 }
     > P.consume()           // if history has NO result will return a promise waiting for first result come
     Promise { <pending> }
     > increased
     end: 2021-12-01T10:04:29.858Z
     begin: 2021-12-01T10:04:29.860Z

     > P.consume()
     Promise { <pending> }
     > P.consume()
     Promise { <pending> }
     > P.history_
     []
     > increased
     end: 2021-12-01T10:04:39.864Z
     begin: 2021-12-01T10:04:39.865Z
     > P.consume()
     Promise { <pending> }
     > increased
     end: 2021-12-01T10:04:49.874Z
     begin: 2021-12-01T10:04:49.875Z

     > P.history_
     []
     > P.history_
     []
     > P.history_increased
     end: 2021-12-01T10:04:59.878Z
     begin: 2021-12-01T10:04:59.880Z
     [ { sum: 21 } ]
     > P.consume()
     { sum: 21 }
     > increased
     end: 2021-12-01T10:05:09.889Z
     begin: 2021-12-01T10:05:09.890Z

APIS

  • DFLT_COPY
  • creat_pulse(executor,ctx,copy=DFLT_COPY)

LICENSE

  • ISC