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

@esconf/preset-mini

v0.5.1

Published

`esconf` 的最小预设

Downloads

97

Readme

@esconf/preset-mini

esconf 的最小预设

内置解析器一览

  • .mts .ts .cts .mjs .js .cjs 基于 jiti@2 导入
  • .json .jsonc .json5 .yaml .yml .toml 基于 confbox 导入
  • .${name}rc ${homedir}/.${name}rc 基于 rc9 导入

注意: 预设 js,ts 解析只包含 es module 的解析

npm version npm downloads bundle size license

安装

# ✨ Auto-detect
npx nypm install @esconf/preset-mini

# npm
npm install @esconf/preset-mini

# yarn
yarn add @esconf/preset-mini

# pnpm
pnpm install @esconf/preset-mini

# bun
bun install @esconf/preset-mini

# deno
deno install @esconf/preset-mini

简单使用

import { loadConfig } from '@esconf/core'
import { presetMini , tsParser } from '@esconf/preset-mini'

const config = await loadConfig({
    presets:[
      presetMini({
        // 配置如下会解析 vite.config.{cts,ts,mts} vite.{toml,....}
        name:'vite',
        configName:'config',
        // 设置 ts 文件解析规则
        ts:{
          fsCache: false
        },
        // 关闭js 文件解析
        js: false,
        // ....
      })
      ],
    // 数组越靠前配置文件的优先级越高
    // layers 的优先级比 presets 高
    layers: [
      {
        // load from vrx.config.{mts,ts}
        files: ['vrx.config'],
        extensions: ['mts', 'ts'],
        parser: tsParser(),
      },
    ],
    // 配置默认值
    default: { defaultValue: 'value' },
    cwd: process.cwd(),
    // 如果某个 layer 命名了,可以用 layer 的名称在运行时排除
    excludeLayer: ['preset-mini:toml'],
    // 如果 excludeLayer 的 类型时 funcition ,则可以根据 layer 配置的特征自行决定运行时是否排除
    excludeLayer: (layer) => layer.extensions.includes('yaml')
  })

鸣谢

贡献者

Published under the MIT license. Made by @Colourlessglow and community 💛


🤖 auto updated with automd