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

@ecoding/helper.env

v0.0.9

Published

dev env

Downloads

2

Readme

环境判断类

基础环境判断

使用

import ugenv from "@ecoding/helper.env";
const clientInfo = ugenv.getClientInfo();
const envInfo = ugenv.getEnvInfo();

返回

(deviceUdID、deviceUdidToken、deviceId、ursAuth)来自客户端约定:旧的 App 是通过 URL 上的 querystirng 传递相关参数的。新版 App 将传参方式改成把参数挂到 window.appInfo 对象上(通过注入 js 脚本的方式)

注意:

客户端新开 webview 时才会注入 deviceUdID、deviceUdidToken、deviceId、ursAuth,如果时 webview 与 webview 之间跳转则不生效

// clientInfo
{
    os: string;
    network: string;
    userAgent: string;
    systemVersion: string;
    iosSystemVersion: string | number;
    kaolaVersion: string;
    deviceUdID: string | null;
    deviceUdidToken: string | null;
    deviceId: string | null;
}
// envInfo
{
    os: string; // ios | aos | wap
    isapp: boolean; // 是否考拉app
    isios: boolean; // 是否ios
    isaos: boolean; // 是否安卓
    iswx: boolean; // 是否微信(包括微信小程序)
    isalipay: boolean; // 是否支付宝(包括小程序)
    iswapqq: boolean; // 是否qq
    iswaptaobao: boolean; // 是否手机淘宝
    iswapdingding: boolean; // 是否手机钉钉
    iswapweibo: boolean; // 是否微博
    iswapyouku: boolean; // 是否优酷
    iswapwx: boolean; // 是否微信(仅微信不包括微信小程序)
    iswapalipay: boolean; // 是否支付宝(不包括小程序)
    isminiwx: boolean; // 是否微信小程序
    isminialipay: boolean; // 是否支付宝小程序
    isminibaidu: boolean; // 是否百度小程序
    isminibd: boolean; // 是否字节跳动旗下小程序
    isminitt: boolean; // 是否 今日头条、今日头条极速版 小程序
    isminidy: boolean; // 是否抖音小程序
    isminixg: boolean; // 是否西瓜视频小程序
    isanymini: boolean; // 是否小程序(包含微信、字节跳动旗下小程序、百度、支付宝)
    now: "app" | "waptaobao" | "wapdingding" | "wapwx" | "wapqq" | "wapweibo" | "wapalipay" | "wapyouku" | "minialipay" | "miniwx" | "minibaidu" | "minitt" | "minidy" | "minixg" | "wap";
}