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

@ct0/functions

v1.18.20240226

Published

A pure functions set to help developer easy to handle common things, probably

Downloads

39

Readme

@ct0/functions

这里用来放跨项目的公共方法,纯函数方法

使用方法

npm i [@ct0/functions](https://www.npmjs.com/package/@ct0/functions)

开发流程

向 https://gitee.com/ct0/functions 代码库提交 Merge Request 代码。

添加新方法注意事项

  1. 不允许 引用第三方库,公共方法不是三方库的入口
  2. 不允许 使用有状态方法,这是纯函数方法库,类似 lodash
  3. 不允许 修改已存在方法的当前行为,只能修复 bug

文档

~~通过代码中的 jsdoc 生成文档,因为需要支持 TS,所以使用工具 better-docs。~~

发布

发布检查列表

  • [ ] 编写文档
  • [ ] 测试覆盖率 100%
  • [ ] 修改版本号(通过 npm run build 自动修改)
  • [ ] git 提交信息使用 约定式提交

发布方法

# 保证 100% 测试覆盖率
npm run test
# 构建发布内容
npm run build
# 更新版本号
npm run version
# 更新 package-lock.json 中的版本号
npm i
# 发布到 npmjs
npm publish --access=public --registry=https://registry.npmjs.org

FAQ

  1. 为什么不直接使用三方库,比如 lodash?

    这是针对万象项目的公共业务方法,如果只是 clone 、flatten 等方法,应该直接使用 lodash。

  2. 为什么项目内不能引用第三方库?

    跨项目公共方法,的核心要求是稳定,稳定的基础出简单,因此不能引用第三方库。

  3. 有个方法的命名或默认行为写的很不好,可以直接修改吗?

    不行,另写一个方法。