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

bed-lib

v0.0.2

Published

公共业务库

Readme

bed-lib

文档地址

https://bed.run/docs/bed-lib/

安装

# 通过 npm 安装
npm i bed-lib -S

# 通过 yarn 安装
yarn add bed-lib

快速上手

import { isObject } from "bed-lib";
import { fen2yuan } from "bed-lib";

isObject(1); // 是否是对象
fen2yuan(1); // 分转换元

按模块引入

import { isObject } from "bed-lib/es/base";
import { fen2yuan } from "bed-lib/es/currency";

isObject(1); // 是否是对象
fen2yuan(1); // 分转换元

按需引入(推荐)

import { isObject } from "bed-lib/es/base/methods/type";
import { fen2yuan } from "bed-lib/es/calc/methods";

isObject(1); // 是否是对象
fen2yuan(1); // 分转换元

开发

启动命令

# 启动本地 API Site
# PS: 注意第一次跨项目调试时需要执行build命令在本地构建出es目录
npm run dev

# 启动本地 Demo App
npm run start:app

# 构建文档
npm run build:doc

# 部署API文档和 Demo(本地执行)
npm run release:site

部署文档

  1. npm run release:site(此时会自动打开部署站点)
  2. 点击 work 部署

提交规范

  • 每个提交都必须使用类型字段前缀,它由一个名词构成,诸如 feat 或 fix , 其后接可选的范围字段,可选的 !,以及必要的冒号(英文半角)和空格。
  • 当一个提交为应用或类库实现了新功能时,必须使用 feat 类型。
  • 当一个提交为应用修复了 bug 时,必须使用 fix 类型。
  • 范围字段可以跟随在类型字段后面。范围必须是一个描述某部分代码的名词,并用圆括号包围,例如: fix(parser):

更多详细规范参考约定式提交规范

模块设计

import { 成员 } from "bed-lib/模块";
- /src
  - /auth # 授权
  - /base # 基础模块
  - /car # 车型
  - /calc # 计算
  - /order # 订单
  - /hybrid # 原生
  - /user # 用户
    - /methods # 纯函数
    - /models  # 逻辑类
    - /filters # Vue 过滤器
    - /directives # Vue 指令
    - /plugins  # Vue 插件
    - /types  # TS类型定义
    - /mixins  # Vue Mixin
    - /hooks  # Composition API
    - index.ts
    - methods.ts
    - models.ts
  - index.ts

TypeDoc 规范

| 名称 | 作用 | 备注 | | ------------ | ---------- | ---------------------------------------------------------------------- | | @param | 参数描述 | 仅供类、接口、方法注释时使用。同一个注释块可同时出现多个 param 描述。 | | @return | 返回描述 | 仅供方法注释时使用。除 void 方法外其它所有方法必须有一个 return 描述。 | | @throws | 异常描述 | 零到多个。 | | @exception | 异常描述 | 零到多个。 | | @author | 作者 | 类和接口注释中必须有。可有零到多个。 | | @version | 版本描述 | 类和接口注释中必须有。零或一个。 | | @see | 参考描述 | 可有零到多个。 | | @since | 起始版本 | 只有一个。 | | @serial | 序列化描述 | 或 @serialField 或 @serialData,可有多个 | | @deprecated | 废除标志 | 最多一个。 |