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

srf-native-bridge

v0.13.0

Published

## Integrate the bridge in a web view

Readme

SRF Native Bridge

Integrate the bridge in a web view

  • Run npm install --save srf-native-bridge
  • If you need to support SRF apps that still use the old version of the native bridge, include the following code directly in your HTML file. This code should not be loaded later, because old apps need to be able to execute these functions immediately after loading.
<script>
  function fetchMetaData() {
    window.legacyAppReady = true;
  }

  function setAutoplayEnabled(autoplay) {
    window.legacyAutoplayEnabled = autoplay;
  }

  function setDeviceInfo(data) {
    window.legacyDeviceInfo = data;
  }
</script>
  • Initialize the bridge with the metadata of the page:
import { SRFBridge } from 'srf-native-bridge';

SRFBridge.init({
  title: 'Your Page Title',
  weburl: 'https://www.srf.ch/sport',
  subscriptionLists: ['sport_subscription_list'],
});

After these steps, the bridge connection is established, and you can start to send and receive events using the public API, which is exported and documented in index.ts.

Setup dev environment

To start developing new features for the bridge, simply run:

  • npm install
  • npm run dev which will watch the source files and start a web server with a demo page on http://localhost:8080/dev/

Add a new event to the bridge

  • Add the new event with its payload to event-types.ts
  • (optional) If you want to provide a convenience function to the JavaScript users of the bridge, add it to the public API in index.ts
  • Release the package

Hint: you do not need to manually update the package version. This happens automatically when you release the package, see section Release.

Test

  • npx tsdx build; npx tsdx test will build and run all tests.
  • npx tsdx lint will run the linter

Release

To create new release do the following:

  • Merge all features you want to publish in the main branch
  • Run npm login (the SRF username and password can be found in safe.srgssr.ch - 2FA as well!)
  • Run npm run release and follow the instructions

Note: We use np to publish this package to NPM.

Additional docs