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

togetu-core

v1.0.4

Published

togetu team js core

Readme

togetu 核心 npm 包

js bridge

1、支持 promise和callback 2种方式

// 例子1(无参数)
jsBridge("login",{
    callback(err,res){
        // 业务代码
    }
)

jsBridge("login").then((res)=>{}).catch((err)=>{});

// 例子2(带参数)
// 目前
jsBridge('copyToClipborad',{
  ...
  callback(err,res){
  }
});
// 建议1
jsBridge("copyToClipborad",{...}).then((res)=>{}).catch((err)=>{});

2、callback模式中 错误信息 统一归纳在第一个参数 err

3、语法糖

// pushWindow
jsBridge("pushWindow",'http://xxxxx.com');
jsBridge("pushWindow",{...});

// jumpWindow
jsBridge("jumpWindow"); //只是后退-1;

// alert
jsBridge("alert","xxxxxxx"); // 默认补全 buttonText 

// confirm
jsBridge("confirm","xxxxxxx"); // 默认补全 confirmButtonText,cancelButtonText

// showLoading
jsBridge("showLoading"); // 默认:hasIcon="true" content="" delay=0
jsBridge("showLoading",1000); // 默认:hasIcon="true" content="" 一秒后自动关闭
jsBridge("showLoading",{...});// 完整版

// copyToClipborad
jsBridge("copyToClipborad","xxxxxx");
jsBridge("copyToClipborad",{...}); // 完整版

埋点

<!-- 在HTML中插入以下代码,用于 ga 和 Matomo 埋点统计 -->
<!-- Google Analytics -->
  <script>
    (function (i, s, o, g, r, a, m) {
      i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
        (i[r].q = i[r].q || []).push(arguments)
      }, i[r].l = 1 * new Date(); a = s.createElement(o),
        m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
    })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
    if (window.location.hostname === 'g.togetu.in') {
      ga('create', 'UA-127168940-2', 'auto');
    } else {
      ga('create', 'UA-127168940-3', 'auto');
    }
  </script>
  <!-- End Google Analytics -->
  <!-- Matomo -->
  <script type="text/javascript">
    window._paq = window._paq || [];
    /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
    _paq.push(['trackPageView']);
    _paq.push(['enableLinkTracking']);
    (function () {
      var u = "https://togetu.matomo.cloud/";
      _paq.push(['setTrackerUrl', u + 'piwik.php']);
      _paq.push(['setSiteId', '1']);
      var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
      g.type = 'text/javascript'; g.async = true; g.defer = true; g.src = u + 'piwik.js';s.parentNode.insertBefore(g, s);
    })();
  </script>
  <!-- End Matomo Code -->
  

集成阿里云sls,ga, Matomo三种埋点 其中sls 和 Matomo 默认带参

    this.params = {
      currentPage: window.location.href,
      UA: navigator.userAgent,
      isToGetUApp: !!isToGetUApp,
      H5_deviceId: H5_deviceId,
    }
    if(userInfo) {
      this.params.uid = userInfo.tid
    }
    if(appInfo) {
      this.params.app_deviceId = appInfo.deviceId;
      this.params.app_version = appInfo.version;
      this.params.app_version_name = appInfo.name;
    }
    if(bridge_userInfo_err) {
      this.params = Object.assign(this.params, bridge_userInfo_err)
    }
    if(bridge_appInfo_err) {
      this.params = Object.assign(this.params, bridge_appInfo_err)
    }

使用方式

// 埋点 pv/uv
push_log({}, 'pageview')
// 其它
push_log({})

唤起 APP