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

@syncthetic/emitter

v0.0.2

Published

To get started, install the package `npm i @syncthetic/emitter`

Readme

@syncthetic/emitter

An angular library to watch for event changes. Fire events when a defined event returns true

To get started, install the package npm i @syncthetic/emitter

importing the emitter service import { EmitService } from '@syncthetic/emitter'

constructor config, of course... constructor ( private emitter: EmitService, ... ) {}

Triggers and their options are configured in the following interface format

interface Trigger {
  check: Function,
  callback: Function
  options?: TriggerOptions
}
interface TriggerOptions {
  originalValue?: any,
  newValue?: any,
  dataSet?: any
}

To set up our event emitter, a few things need to be established.

You need a compare function, which will be run by the EmitService defined as the Trigger.check value. The function should return a boolean based value. When this function return true, the Trigger.callback function will be called. If Trigger.options exist and are defined, it will be passed into the check and callback functions.

Let's see some code...

In this exmaple, I have designed a small snippet, which runs on an array of numbers to detect if a change occured at a specific index.

numbers_differ ( options ) {
  console.log('would compare', options.originalValue, ' with ', options.dataSet.data[1])
  options.newValue = options.dataSet.data[1]
  return options.originalValue !== options.dataSet.data[1]
}

show_number_differs ( options ) {
  alert( options.originalValue + ' does not equal ' + options.newValue )
}
  
this.emit.add_trigger({
    check: this.numbers_differ,
    callback: this.show_number_differs,
    options: { originalValue: this.data.data[1], dataSet: this.data }
})
// starts the EmitterService to check for triggers
this.emit.trigger_loop()

Here's what we did

  1. We initialized a trigger to watch the the array (this.data.data[1]) value at index 1
  2. We pass in the options, to our check function so we can see the originalValue and dataSet (the array to monitor), and to be able to set the newValue from the callback function.

Here is the data.service.ts file generating our data.data list.

export class DataService {

  data: Number[] = []
  constructor() { 
    this.start_randomizing()
    this.show_data()
  }

  generate_data () {
    console.log('generating data')
    const new_data = []
    for (let i = 1; i < 10; i++) {
      const n = Math.floor(Math.random()*(999-100+1)+100)
      new_data.push(n)
    }
    this.data = new_data
  }
  
  start_randomizing () {
    setInterval(this.generate_data.bind(this), 3000)
  }
}