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

@x-edu/channel

v0.0.2

Published

## API

Downloads

81

Readme

@x-edu/channel

API

getChannelData

获取频道数据

  await getChannelData({
    channelId, // 必填 频道 ID
    userRole, // 选填 用户角色,用于过滤频道板块
    loginStatus, // 选填 登陆状态 用于过滤频道板块
    platform, // 选填 平台 WEB | AAP,默认 WEB
    env, // 选填 环境 ‘preprodcution’ | ‘ncet-xedu’ 默认 ‘ncet-xedu’
    libraryServiceName, // 选填 库服务名 默认 zxx
    appid, // 必填
    isPreset, // 选填 默认 false
    filter, // 选填 (section) => boolean 板块过滤函数
  })

  /**
   * 1. 内部根据配置进行过滤,配置项为 是否需要登陆 角色权限
   * 2. platform 只有在管理台选中 APP 时才需要特殊处理,主要用于 web 和 app 展示不同数据的情况
   * 3. 自定义板块的数据格式和移动端保持一致
   **/

convertBannerSection

图片轮播板块数据转换

  convertBannerSection(section) // section 为 getChannelData 返回的数组中的一项

convertWindowRecommend

橱窗推荐板块数据转换

  await convertWindowRecommend(section) // section 为 getChannelData 返回的数组中的一项

convertMutipleGroupRecommend

专题多组推荐板块数据转换

  await convertMutipleGroupRecommend(section) // section 为 getChannelData 返回的数组中的一项

convertProvider

自定义板块数据转换

  await convertProvider(section) // section 为 getChannelData 返回的数组中的一项

convertSpecialRecommend

专题推荐板块数据转换

  await convertSpecialRecommend(section) // section 为 getChannelData 返回的数组中的一项

Platform

平台枚举

export enum Platform {
  WEB = 'WEB',
  APP = 'APP',
}

Env

环境枚举

LibraryServiceName

库服务名枚举

LoginStatus

登陆状态

备注

  1. 图标导航板块不提供数据转换函数,直接取里面的 static_data 即可

TODO

  1. 支持点赞、浏览、收藏等动态数据获取