config-file
form8ion utility for managing RC files
![Codecov](https://img.shields.io/codecov/c/github/form8ion/config-file?logo=codecov)
Table of Contents
Usage
![Try @form8ion/config-file on RunKit](https://badge.runkitcdn.com/@form8ion/config-file.svg)
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
![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg?logo=renovatebot)
Dependencies
$ nvm install
$ npm install
Verification
$ npm test