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

publify

v1.0.3

Published

Action based PubSub Library on top of Socket.io

Readme

Publify.js

Action based PubSub Library on top of Socket.io ####Making real-time event based code much simpler and maintainable

#Installation

 npm install --save publify

How to Use

Publifyjs can be used in both Server and client side.

On the server side

 var app = require('express')();
  var server = require('http').createServer(app);
  var io = require('socket.io')(server);
  var publify=require('publify')(io);

For es6

import Publify from 'Publify'
import io from 'socket.io'
const publify =Publify(io);

On the client side

<script src ='..pathto/socket.io.js'></script>
<script src ='..pathto/publify.js'></script>
 
 <script type='text/javascript'>
 var publify=Publify(io);
 ....
 </script>

API documentation

###Publify.init(userid:string,subsrictions:object , callback:function)

Initializes the Socket connections and listens for subscribed actions

userid: the user .

subcriptions : Object , A collection of subscribed actions with callbacks in the format { action : callback}

               example : { 'ADD_USER' : function(){
                               console.log('user added'),
                          'FOLLOW_USER' : function(){
                                 console.log('user Followed)}}
                          }

callback : optional

###Publify.publish(action:object)

The action object

Properties

'actionName' (type : string ):

 Name of the action to be Published

'from' / 'source'(type:string):

   from whom the the Action is publised
   

'to'/ 'target' (type : string or Array):

  The target user id or an Array collection of userids

'payload' (type:object):

   data being send to the target

example of an action

  
  action={
     actionName:'Follow',
     from:'i567hg090y'
     to:  'p0908786f5',
     payload: {status:'ok',
               message:'hii'}
  
  }

####then publish the action by Publify.publish(action)

##Publify.subscribe()

Publify.subscribe(actionName :string,callback:function)

Mainly for Clientside Implemetation Can also be used in server side but not preffered . Use Publify.init(..,subscriptions,..) instead due to performance reason

example:

Publify.subscribe('FOLLOW_USER' , function(){...})

###Publify.transmit(actionname:string,callback:function) For Server Side Implemetation only :

It recieves(subscribes) an action and publishes the same to broswer with targeted ids Best For Bidirectional communication like chat.

example : Publify.transmit('MESSAGE', function(){...})

###Publify.createAction(actionName,from,to,payload)

Returns an Object creating an action For client side Uses

###Publify.getConnectedClients() Returns connected clients to the namespace ###Publify.getNameSpace() Returns the Namespace that the user created