ftconfig
v1.1.8
Published
F*ck the config
Downloads
219
Maintainers
Readme
ftconfig
F*ck the config
Usage
Install with npm
npm install ftconfig
import ftconfig = require("ftconfig");
const config = ftconfig.readFile("./package.json")
.modify((obj) => {
config.name = "simple";
return obj
})
.save();
const obj = config.toObject();
Module Methods
ftconfig.readFile(filepath, [options])
Paramseters
filepath
{String}
Filepathoptions
{Object}
encoding
{String="utf-8"}
type
{String}
yaml
json
json5
hjson
toml
ini
Return
Class Config
ftconfig.read(configString, [options])
Paramseters
configString
{String}
config stringoptions
{Object}
type
{String}
yaml
json
json5
hjson
toml
ini
Return
Class Config
ftconfig.read(configString, [type])
Paramseters
configString
{String}
config stringtype
{String}
yaml
json
json5
hjson
toml
ini
Return
Class Config
Config.modify(function)
Paramseters
configString
{Function}
Get which type Return what
Return
Class Config
Config.save([filepath])
Paramseters
filepath
{String}
Targe Filepath
Return
Class Config
Config.save([options])
Paramseters
options
{Object}
path
{String}
encoding
{String="utf-8"}
indent
{Number=2}
Return
Class Config
Config.toString([options])
Paramseters
options
{any}
Return
String
Config.toObject()
Return
Object