輕鬆操作你的 js 相關設定檔

package: config-parser-master
created_at: 2022/07/03 00:00:00
updated_at: 2023/07/03 00:00:00
link: https://github.com/LaiJunBin/config-parser-master

This is a simple config parser that can read and write to a config file.

Currently, it only supports reading and writing to a config file in the following formats:

  • jsmjstsmts(export default)
  • cjs(module.exports)
  • jsonrc(json)
  • ymlyaml

Additionally, it also supports reading javascript or typescript files. (including jsx and tsx)

Install

$ npm install config-parser-master

Simple Usage

import { ConfigParser } from 'config-parser-master';

const config = ConfigParser.parse('./package.json')
config.put('scripts.hi', 'echo hi')
config.save()

在Github上觀看