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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@compass-aiden/helpers

v0.5.0

Published

实用程序库

Downloads

36

Readme

@compass-aiden/helpers

实用程序库

Web端使用文档

Node端使用文档

Getting Started

browser项目使用

npm方式安装:

npm install @compass-aiden/helpers

// 按需导入,自动识别导入esm文件
import { formatDate } from '@compass-aiden/helpers';
// 全量导入
import * as allHelpers from '@compass-aiden/helpers';
// 通过别名路径导入esm文件
import { formatDate } from '@compass-aiden/helpers/esm';

浏览器script标签安装:

<!-- 请根据个人需求采用unpkg或者jsdelivr链接 -->
<script src="https://unpkg.com/@compass-aiden/helpers@latest/dist/compass-helpers.umd.js"></script>
<script>
  console.log(window.CompassHelpers.formatDate());
</script>

node项目使用

npm方式安装:

npm install @compass-aiden/helpers

// 按需导入 自动导入cjs文件
const { createFile } = require('@compass-aiden/helpers');
// 全量导入
const helpers = require('@compass-aiden/helpers');

/** 在type: module启用ESM环境下,请参考如下方式 */
// 通过别名路径导入cjs文件,如果不能识别条件导出,tsconfig可设置 `{ "moduleResolution": "bundler" }`
import { createFile } from '@compass-aiden/helpers/cjs';
// 自动导入默认cjs文件, 当 tsconfig 配置包含 `{ "moduleResolution": "NodeNext" }`时可用
import { createFile } from '@compass-aiden/helpers';

Contributes

Install

pnpm install

Base commands

  • pnpm dev 启用开发模式
  • pnpm build 生产构建
  • pnpm lint 代码校验
  • pnpm format 代码格式化
  • pnpm test 执行单元测试
  • pnpm build:doc 构建文档

添加一个新的工具函数

  1. 请先确定该函数适用的平台 Browser/Node/Common
  2. 通用函数请放入 src/common-utils
  3. browser 平台函数放入 src/browser-utils
  4. Node 平台函数放入 src/node-utils
  5. 为函数添加一定的文档描述,如下示例
// src/browser-utils/example.ts

/**
 * @category Tools
 */
export default function example() {
  console.log('可指定的category在 src/browser.ts 或 src/node.ts 文件顶部声明');
}

更多文档注解参考 TypeDoc

Publish library

提交合并请求至master即可