@form8ion/config-file

中文文档
1.4.1发布于 2026/08/06MITESM + CJS构建来源已验证近 30 天下载 1.4万

form8ion utility for managing RC files

原始使用文档
文档目录8 节
  1. Table of Contents
  2. Usage
  3. Installation
  4. Example
  5. API
  6. Contributing
  7. Dependencies
  8. Verification

config-file

form8ion utility for managing RC files

Node CI Workflow Status Codecov SLSA Level 2

Table of Contents

Usage

MIT license npm Try @form8ion/config-file on RunKit

Installation

$ npm install @form8ion/config-file --save-prod

Example

import {fileTypes} from '@form8ion/core';
import {write} from '@form8ion/config-file';
(async () => {
  await write({
    format: fileTypes.JSON,
    name: 'tool-name',
    path: process.cwd(),
    config: {foo: 'bar', baz: 'qux'}
  });
})();

API

write

Writes the provided config to the appropriate rc file for the named tool

Takes a single options object as an argument, containing:

format string (required)

Format of the file to be written

name string (required)

Name of the tool that the config file is for

path string (required)

Path to the directory that will contain the config file

config object (required)

Configuration to be written to the file

Contributing

PRs Welcome Commitizen friendly Conventional Commits semantic-release: angular Renovate

Dependencies

$ nvm install
$ npm install

Verification

$ npm test

版本与发布记录

@form8ion/config-file 共发布 12 个版本,首次发布于 2022/06/04;过去 12 个月发布了 2 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.4.1latest2026/08/063 个月前
1.4.02026/07/293 个月前
1.3.02024/11/112 年前
1.2.02024/11/112 年前
1.1.22024/01/132 年前
1.1.12024/01/092 年前

其他发布通道:alpha → 1.0.0-alpha.1,beta → 1.1.0-beta.2。

关于 @form8ion/config-file 的常见问题

@form8ion/config-file 是什么?

form8ion utility for managing RC files

如何安装 @form8ion/config-file?

在项目目录运行 npm install @form8ion/config-file,或使用 pnpm add / yarn add / bun add。

@form8ion/config-file 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/form8ion__config-file 是否存在。

@form8ion/config-file 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@form8ion/config-file 可以商用吗?

@form8ion/config-file 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@form8ion/config-file 的下载量有多少?

根据 npm 官方下载统计,@form8ion/config-file 在 2026/10/16 – 2026/11/14 这 30 天内被下载 13,924 次,日均约 464 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@form8ion/config-file 还在维护吗?

最新版本 1.4.1 发布于 2026/08/06(3 个月前);至今共发布 12 个版本,其中过去 12 个月发布了 2 个;首次发布于 2022/06/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。