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

redux-chrome-extension

v1.0.0

Published

Readme

#Redux Chrome Extension

A starter boilerplate for a Chrome Extension using Redux and React.js. It handles store syncing throughout the whole Extension. Uses React for Popup window UI. Console.log in every part of extensions for better debugging.

##Schema

Uses https://developer.chrome.com/extensions/messaging

Background Page

  • gets persistent data for initial state from localStorage (options, user)
  • passes state to Popup Window and Content Scripts and Options
  • receives state updates from Popup Window, Content Scripts and Options
  • saves changes in persistent property to localStorage

Popup Window

  • gets initial state from Background Page
  • dispatches state updates to Background Page (and optionally to Content Scripts)

Content Script

  • gets initial state from Background Page
  • receives state updates from Popup window
  • dispatches state updates to Background Page (and optionally to the rest of Content Scripts)

Options Page

  • gets initial state from Background Page
  • dispatches state updates to Background Page

*** code for functionality that is in parenthesis was commented out, see src/content.index.js and src/popup/index.js ***

Installation

npm i

Development

gulp

Browserify and Watchify are used for building scripts. For more details see: (https://github.com/gulpjs/gulp/blob/master/docs/recipes/fast-browserify-builds-with-watchify.md)

  1. In Chrome open chrome://extensions/
  2. Select Developer mode
  3. Click on Load unpacked extension
  4. Add /dist folder

Example App

  • There is an example counter application
  • Extension's code is located in /app folder
  • Do not edit files in app/scripts/ directly, it will be overwritten*

Releasing

gulp release

You can find .zip packages in the /dist folder.

##Data passing If you understand the Schema above, you see that not every part of extension talk to each other. That's because of in certain cases it doesn't make sense to notify the part, that would otherwise load the whole state from Background Page again.

It's not possible to have Content Script and Popup Window active both in the same time, since Popup Window is autoclosing when it loses focus, and after each invoking it's fetching the state from Background Page. So it doesn't make sense to send any changes from Content Script to Popup Window. Same with Popup Window and Options.

On the other hand Content Script is living behind every tab all the time, so we need to propagate store changes in Popop Window to Content Scripts immediately.

##Storage All the data we need to keep stored in extension after closing Chrome or disabling Extension are being saved to localStorage.

You can modify localStorage indirectly by changing state.persistent property, like Options page in example.

##TODO

  • Replace browserify with webpack

  • Hot loading

  • Testing

  • Issues and pull requests are always welcome!!