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 🙏

© 2024 – Pkg Stats / Ryan Hefner

seer

v4.0.9

Published

A customizable devtool solution

Downloads

13,085

Readme

Seer API

This library provides an abstraction around the Window.postMessage API to interact with the Seer extension. You could use this module if you have a framework or application that wants to display debugging information in the Seer Chrome extension.

Install

Simply download the package from the npm registry

yarn add seer

Notes

The extension will declare a __SEER_INITIALIZED__ boolean on the window, that you can use to check if the extension is installed and prevent any useless processing in production or for real-users.

Internal

How the communication is done exactly relies on the bridge, that you can checkout in its dedicated directory. The following schema represent the complete data flow:

Functions

isReady() ⇒ Boolean

Ready check for Seer initialization

Kind: global function

throttle(key, delay) ⇒ Boolean

Utility method allowing to throttle a user action based on a key and a minimun delay.

Kind: global function

| Param | Type | Description | | --- | --- | --- | | key | String | A unique key | | delay | Number | The minimal delay to throttle |

send(type, payload)

Low-level api leveraging window.postMessage

Kind: global function

| Param | Type | Description | | --- | --- | --- | | type | String | The action type | | payload | Any | The action payload |

init()

Initilize window listener. There will be only one for the whole process to prevent too many registrations.

This method will be called automatically if you use the listenFor method.

Kind: global function

clean()

Clean listener. Can be useful in case you want to unregister upcoming events or liberate memory.

Kind: global function

listenFor(key, cb)

Create a listener that will be called upon events of the given key.

Kind: global function

| Param | Type | Description | | --- | --- | --- | | key | String | The unique tab key | | cb | function | A callback that will receive the message payload |

removeListener(cb)

Remove an identity listener

Kind: global function

| Param | Type | Description | | --- | --- | --- | | cb | function | The callback to remove |

list(key, data)

Creates a new indexed list. It works by index to get O(1) accessing and performance.

Kind: global function

| Param | Type | Description | | --- | --- | --- | | key | String | The key of the tab | | data | Object | The indexed object |

listItem(key, itemKey, data)

Creates an element in the indexed list, based on the itemKey.

Kind: global function

| Param | Type | Description | | --- | --- | --- | | key | String | The key of the tab | | itemKey | String | The key of the item | | data | Any | The value of the item |

updateItem(key, itemKey, path, data)

Update an item property, can be deeply nested.

Kind: global function

| Param | Type | Description | | --- | --- | --- | | key | String | The key of the tab | | itemKey | String | The key of the item | | path | String | The path of the variable you want to update | | data | Object | The new value |

multiUpdate(key, itemKey, array)

Similar to updateItem, but allows to pass an array with {path,data} pairs for multiple update of the same item without having to send multiple messages.

Kind: global function

| Param | Type | Description | | --- | --- | --- | | key | String | The key of the tab | | itemKey | String | The key of the item | | array | Array | The array of updates | | array.path | String | The path for this update | | array.data | Object | The value of this update |

deleteItem(key, itemKey)

Remove a specific item in a specific tab.

Kind: global function

| Param | Type | Description | | --- | --- | --- | | key | String | They key of the tab | | itemKey | String | The key of the item |

addLog(key, itemKey, msg)

Will create a log message to an item, that will be displayde with the current time.

Kind: global function

| Param | Type | Description | | --- | --- | --- | | key | String | The key of the tab | | itemKey | String | The key of the item | | msg | String | The message to display |