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

xtension

v0.0.3

Published

A cross-browser extension library for Chrome, Firefox and Safari

Readme

Simplified Cross Browser Extension Development

Develop one Browser-extension and ship it instantly for Safari, Chrome and more Browsers without adaptations. The xtension library provides an abstraction layer for pain-free cross browser extension development and a handful of API's I found useful while developing Bloom.

This is a new package I initially built for myself and became my first open source project. Please report issues, request features and get in touch with me.

Installation

Install the package with npm or download the script manually and add it to your Extension.

$ npm install xtension --save

Getting Started

To get started with the development, I recommend to use the Example Demo. Alternatively, you can start building a Safari Extension using the Safari Extension Builder.

If you start from scratch, the extension builder will create a folder EXTENSION.safariextension with nothing but an Info.plist file in it.

If you are building a content-script extension, make sure to include the script to your content_scripts: On Safari, use the Extension Builder to add it as one of the first Start Scripts to the Injected Content. On Chrome, open manifest.json in your root extension folder and add this library to your content_scripts:

"content_scripts": [{
    "js": [
      "node_modules/xtension/index.js.js",
      "scripts/content_script.js"
    ]
}],

Include the script early in each head of your extension's html pages:

<script type="text/javascript" src="../node_modules/xtension/index.js"></script>

Congratulations! You are ready to develop your pain-free Browserextension.

Documentation

Call the extension layer with the global variable xt. Example: xt.getGlobal();

getGlobal()

returns the global background script of your extension including its variables and functions. Example usage:

var globalPage = xt.getGlobal();
globalPage.yourFunction();

messageGlobal(message, data)

Sends a Message to your global background script. Returns a promise with a response from your global page. Example usage:

xt.messageGlobal("requestInfo").then(function(response) {
   // do something with the response
});

//or with some data but without a response
xt.messageGlobal("clickedElement", elem);

getUrl(path)

Documentation work in Progress. Have a look at the comments in the index.js file in the meantime.

messageAllTabs(message, data)

Documentation work in Progress. Have a look at the comments in the index.js file in the meantime.

messageActiveTab(message, data)

Documentation work in Progress. Have a look at the comments in the index.js file in the meantime.

messagePopover(message, data)

Documentation work in Progress. Have a look at the comments in the index.js file in the meantime.

openTab(url)

Documentation work in Progress. Have a look at the comments in the index.js file in the meantime.

createTab(url)

Documentation work in Progress. Have a look at the comments in the index.js file in the meantime.

changeLocation(url)

Documentation work in Progress. Have a look at the comments in the index.js file in the meantime.

setPopupWindow(url)

Documentation work in Progress. Have a look at the comments in the index.js file in the meantime.

browserInfo()

Documentation work in Progress. Have a look at the comments in the index.js file in the meantime.

addEventListener(name, handler)

Documentation work in Progress. Have a look at the comments in the index.js file in the meantime.

removeEventListener(name, handler)

Documentation work in Progress. Have a look at the comments in the index.js file in the meantime.

fireEvent(name, args[])

Documentation work in Progress. Have a look at the comments in the index.js file in the meantime.