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

@tikkhun/config-core

v0.3.2

Published

config 其实就是将分布式的配置源合并起来, 最终将他转化成集中式管理的一个配置对象

Readme

config

config 其实就是将分布式的配置源合并起来, 最终将他转化成集中式管理的一个配置对象

  • 实现源的合并
  • 实现配置对象的获取与存储
  • 实现对这个配置对象的 get set reset remove 的api操作.
  • 实现对合并的生命周期以及api操作的监听
    • on('inited')
    • on('load')
    • on('change') set reset remove都会触发

ConfigSource 配置源

实现 load 方法让 config 可以从source处加载到配置对象.

EnvSource 获取 .env的数据

经常使用.env进行配置,但经常需要转换成对象使用 默认分隔符为__ 一般不会冲突

Storage 存储器

存储所有加载的配置 并且可以获取这些配置 默认使用memoryStorage. 你可以编写自己的Storage

使用

详见example 如果是nodejs推荐直接使用 @tikkhun/config 如果是web 推荐直接使用 @tikkhun/web-config

import { DEFAULT_ENV_MANAGER } from '@tikkhun/config';
console.log(`env`, DEFAULT_ENV_MANAGER.get()); // 获取全部
console.log(`env`, DEFAULT_ENV_MANAGER.get({ path: 'c.c.c' })); // 支持 path形式获取

实现

配置一个是 api get set reset 的api wrapper save 另一个是source 也就是源数据 最后一个是 config watch

流程

sources--load and merge-->initialConfig--watch->configWatcher--wrapApi->config

source

  • env
    • 前端如果使用vite会帮你搞好给你设置, 结合 @tikkhun/env-source 初始化
    • 后端需要env loader 结合 @tikkhun/env-source 初始化
  • 一种是localstorage , // 前端存储
  • 一种是 文件config-loader // 文件配置 可以使用 @tikkhun/config-loader 这个库读取
  • 一种是远程获取