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

@nbrowser/nb-chan

v0.0.3

Published

nbrowser dispatch

Readme

@nbrowser/nb-chan

npm (scoped) npm bundle size (minified)

nb-chan is a cross-domain event emitter for Nucleome Platform. nb-chan has the same initialize method and the same function interface "on" and "call" as d3-dispatch.

if user install our chrome extension Nucleome Bridge, nb-chan will use Nucleome Bridge to send event emittion between tabs from multiple domains, otherwise, it will use web browser's BroadCast Channel to send event emittion between tabs within the same domain.

Our Web Application Nucleome Browser is connected with nb-chan.

Connect

Connect to channel.

import {chan} from "@nbrowser/nb-chan";
var c = chan("update","brush")
var callback = function(status){
  console.log(status)
}
c.connect(callback)

Listen to events in all chan connected tabs.

//receive message from nbrowser bridge or BroadCast Channel.

c.on("update",function(d){
  //Add your code (user navigate to these genome coordinates in other tab, respond accordingly )
})
c.on("update.anything",function(d){
  //register multiple listeners as d3-dispatch
  //Add your other code (user navigate to these genome coordinates in other tab, respond accordingly )
})
c.on("brush",function(d){
  //Add your code  (user brush these genome coordinates in other tab, respond accordingly )
})

Emit events to all chan connected tabs.


var regions = [{genome:"hg38",chr:"chr1",start:1,end:10000},{genome:"hg38",chr:"chr2",start:1,end:1000}]

c.call("update",this,regions)

c.call("brush",this,regions)

Installing

If you use NPM, npm install @nbrowser/nb-chan. If you use in your webpage,

<script src="https://vis.nucleome.org/static/lib/nb-chan.min.js"></script>
<script>

var c = nb.chan();
c.connect(function(status){
    //add your code callback.
});

</script>

Connect your web page with Nucleome Bridge

Nucleome Bridge now support communication with UCSC Genome Browser and WashU EpiGenome Browser.

Due to the web safety reason, any web sites which want to connect with Nucleome Bridge needs to satisfty the pattern specify in Nucleome Bridge manifest.json file.

Currently, any local website, whose IP address is such as *://127.0.0.1:*/*, is connectable with Nucleome Bridge.

For user sharing their web pages, https://bl.ocks.org/* is also connectable with Nucleome Bridge. User can share their web page in this website by submit their code to gist. For futhur information. Please read this webpage. We also have some demos in bl.ocks.org, here is the link.

If you want to your website can be connectable with Nucleome Bridge, Please contact us.

API Reference

Check the connection status of channel

  var c = nb.chan()
  c.connect(function(){
    console.log(c.status())
  }

Currently, standard communication code

event name: update and brush.
pass data: regions = [region... ]
           region format {genome:string,chr:string,start:int,end:int}

Start and end is defined as same as bed format. Start is 0-index. and end is not included in this region.