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

@hecom/meta

v2.5.12

Published

Meta Object Module

Downloads

102

Readme

Meta

npm version Build Status

元数据管理模块。

接口

  • name: string:模块名称。
  • init({loadMeta}): void:全局初始化模块,注入loadMeta实现,应在程序启动时调用。
  • uninit(): void:注销,清空缓存的元数据。可根据需要在合适的场景调用(例如:退出登录时)。
  • load(metaName): Promise<meta>:获取最新的元数据。meta代表元数据对象,下同。
  • loadIfInvalid(metaName): Promise<meta>:如果不存在缓存,则获取最新元数据,否则返回缓存元数据。
  • isValid(metaName): boolean:是否存在元数据缓存。
  • get(metaName): meta:获取缓存元数据。
  • register(metaName, handleFunc): handleId:注册元数据处理函数,获取缓存元数据前,可对指定metaName的元数据进行预处理。
    • handleFunc(meta): newMeta:元数据处理函数。
  • unregister(handleId):取消注册元数据处理函数。
  • getDetailInfo(metaName: string, key: string, mapKey: string):array|object:获取meta[key],如果是数组,则按照mapKey转为对象。
  • layoutOfBizType(metaName, biztypeId):获取指定元数据的指定业务类型的页面布局配置。
  • layoutKeyFields(metaName, biztypeId):获取指定元数据的指定业务类型的摘要字段。
  • selectOfBizType(metaName, biztypeId, fieldMeta):获取指定元数据的指定业务类型的指定字段(单选)的可用选项。
  • part:获取指定部分的元数据信息。
    • auth:权限
    • meta:基本信息
    • field:字段列表
    • biztype:全部业务类型列表
    • activeBizType:可用业务类型列表
    • relate:关联对象信息列表
    • button:按钮信息列表
    • fieldDependency:字段依赖关系列表
    • search:搜索设置信息