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

@hyext/config

v2.1.10

Published

多个 npm 包都会用到的一些 hyext 工具/配置, export 以下内容:

Downloads

664

Readme

hyext config

多个 npm 包都会用到的一些 hyext 工具/配置, export 以下内容:

  • extTypes, 小程序类型列表, 数据结构如下:
interface ExtTypes = Array<{
  extType: string
  platform: 'web' | 'pc' | 'app'
  longName: string
  name: '面板' | '浮窗'
  role: 'audience' | 'streamer'
}>
  • hyextHostInfo, 获取默认的 hostInfo 数据(不经接口获取, 数据可能不是最新)
interface HostInfos Array<{
  hostId: 'huyaext'
  hostName: '虎牙直播'
  hostDesc: null
  extTypes: Array<{
    typeName: string // 虎牙直播APP-面板
    typeTag: string // app_panel
    showType: 'panel' | 'popup'
    runTerminal: 'APP' | 'PC' | 'WEB'
    isAnchor: 0 | 1
    hostId: 'huyaext'
    npmPackageName: string // @hyext/hyext-rn-sdk
  }>
}>
  • getBuildTypes, 弹出TUI界面让开发者选择开发的终端类型
入参 defaults, 小程序类型列表: string[]

返回: Promise<buildTypes>

interface buildTypes Array<{
  extType: string
  platform: string
}>
  • getCliConfig, 获取 @hyext/cli 的配置

@hyext/cli 在磁盘上存储了配置, 目前有用户的token, 当前登录的环境等等

当传入 false 时, 将重置当前环境的 token
getCliConfig(isReset: boolean): CliConfig

interface CliConfig {
  currentEnv: 'prod' | 'test'
  prod: {
    token: string
  }
  test: {
    token: string
  }
}
  • apiFactory
interface Request {
  findExtTypeList4Cli: () => Promise<HostInfos>

  getDeveloperInfo: () => Promise<{
    appId: string
    authorName: string
    authorUid: number
    roomId: number
  }>
}
  • logger

基于 chalk 的 logger 工具

interface Logger {
  error: text => void // red
  warn: text => void // yellow
  info: text => void // cyan
  success: text => void // green
}