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

@stealthex-io/widget

v1.0.1

Published

StealthEX widget library

Downloads

95

Readme

Build Size Version Maintained Issues

StealthEX brings you a handy cryptocurrency exchange widget for crypto-related websites. Exchanges are always private, custody-free and take just a couple of clicks (and a personal wallet) to perform.

All the swaps made with the widget grant you profit + the appearance and assets you would like to highlight are customizable. Register is StealthEX Partner Account to track the stats and get all the info on our affiliate tools here.

Install

npm

npm install @stealthex-io/widget
import widget from "@stealthex-io/widget"

CDN (unpkg)

https://unpkg.com/@stealthex-io/widget/dist/index.browser.js

This version creates window.stealthexWidget object with all exported methods.

Create a container and attach id to it

<div id="stealthex-widget-container"></div>

Initialize your widget

  1. Copy your widget id in the Partner profile Code tab

  2. Use the init method:

const cleanup = widget.init("your-id")
  1. init returns a cleanup function that you can use to prevent memory leaks

Optionally listen to events

const handler = () => {
  console.log("Exchange started!")
}

widget.events.on("exchangestart", handler)
widget.events.off("exchangestart", handler)

API

init(id, options)

Returns a cleanup function: () => void

id

Type: string

This is your widget id that you can get in the Partner profile Code tab.

options

Type: object

| Key | Type | Description | Default value | | ----------- | -------- | ---------------------------------------------- | -------------------------- | | size | number | Widget width size | 330 | | containerId | string | HTML container id where widget will be mounted | stealthex-widget-container | | iframeHost | string | The widget iframe base URL | https://stealthex.io |

events.on(event, listener)

Returns: void

event

Type: string

Available events:

| Event | Value | | ------------- | ----------- | | exchangestart | undefined | | statuschange | string |

listener

Type: (data) => void

events.off(event, listener)

Returns: boolean (false if listener wasn't subscribed to event)

listener

Type: (data) => void

The listener that was previously subscribed.