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

@protorians/signalable

v0.0.14

Published

Signal's Events Manager

Readme

Protorians Signal

Protorians Signal is a Javascript event handler. The primary goal is to have a list of functions typed with the pair name: arguments, all from an existing object.

Multiple signal

It is a signal that manages several types of signals. The goal is to have a grouping of signals within the framework of a more global use.

Use cases

It can be implemented as part of a multi-level treatment. Let's imagine that we have a class that has the following methods:


interface IGenV{
  
}

class Genv implements IGenV{
  
   parse(){
     //...
   }
  
   commit(){
     //...
   }
  
   push(){
     //...
   }
  
}

In our example, each method can call a type of signal.

How it works

  • To begin, you would need to create the signal typing.
type IMySignal = {
   initialize: boolean;
   parse: string[];
   commit: string[];
   push: boolean;
}
  • Then, build your signal
this.signal = new Signalables<IGenvable, IMySignal>(genvableInstance)
  • Set headphones
class Genv {

   signal: ISignalable<IGenV, IMySignal>
   files: string[]
   validated: boolean = false

   constructor(instance: IGenvable, files: string[]) {
     this.files = files;
     this.signal = new Signalables<IGenvable, IMySignal>(instance);
   }

   initialize() {
     this.signal.listen('parse', context => console.log(context))
     this.signal.listen('commit', context => console.log(context))
     this.signal.listen('push', context => console.log(context))
   }

   run() {
     this.initialize()
   }

}
  • Trigger eavesdropping

class Genv {
  
   //..

   parse() {
     this.signal.dispatch('parse', this.files)
   }

   commit() {
     this.signal.dispatch('commit', this.files)
   }

   push() {
     this.signal.dispatch('push', this.validated)
   }

   //..
}

Autonomous signal

It is a singular signal unit which is managed independently. The goal is to manage a single type of isolated signal within the framework of very precise use.

Use cases

It can be implemented as part of a single-level treatment. Let's imagine that we have a function doing a single processing but need to trigger a signal when the processing is carried out:


type IGenV = {}
function genv(): IGenV {
}

How it works

  • To begin, you would need to create the signal typing.
type IMySignal = boolean
  • Then, build your signal
const signal = new Signalable<IGenvable, IMySignal>(genvableInstance)
  • Set headphones

function genv(): IGenV {
   // ...
     signal.listen(context => console.log(context))
   // ...
}
  • Trigger eavesdropping
mySignal.dispatch(true)

Protorians ;)