Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ftconfig

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ftconfig - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

4

dist/WriteConfig.js

@@ -23,4 +23,4 @@ "use strict";

options = Object.assign({
indent: 2,
options: "utf-8"
encoding: "utf-8",
indent: 2
}, this.options, options);

@@ -27,0 +27,0 @@ if (options.path && options.encoding) {

@@ -31,4 +31,4 @@ import * as fs from "fs";

{
indent: 2,
options: "utf-8"
encoding: "utf-8",
indent: 2
},

@@ -35,0 +35,0 @@ this.options,

{
"name": "ftconfig",
"version": "1.1.0",
"version": "1.1.1",
"description": "F*ck the config",

@@ -59,2 +59,3 @@ "main": "dist/index.js",

"@types/ini": "^1.3.30",
"@types/js-yaml": "^3.11.2",
"@types/json5": "0.0.30",

@@ -61,0 +62,0 @@ "@types/make-dir": "^1.0.3",

@@ -13,2 +13,126 @@ # ftconfig

## Usage
### Install with npm
```bash
npm install ftconfig
```
```typescript
const ftconfig = require("ftconfig");
const config = ftconfig.loadFile("./package.json")
.modify((obj) => {
config.name = "simple";
return obj
})
.save();
const obj = config.toObject();
```
## Module Methods
### ftconfig.readFile(filepath, [options])
#### Paramseters
- `filepath` `{String}` Filepath
- `options` `{Object}`
+ `encoding` `{String="utf-8"}`
+ `type` `{String}`
- `yaml`
- `json`
- `json5`
- `hjson`
- `toml`
- `ini`
#### Return
Class `Config`
### ftconfig.read(configString, [options])
#### Paramseters
- `configString` `{String}` config string
- `options` `{Object}`
+ `type` `{String}`
- `yaml`
- `json`
- `json5`
- `hjson`
- `toml`
- `ini`
#### Return
Class `Config`
### ftconfig.read(configString, [type])
#### Paramseters
- `configString` `{String}` config string
- `type` `{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`
[NPM_URL]: https://img.shields.io/node/v/ftconfig.svg?style=flat-square&maxAge=600

@@ -15,0 +139,0 @@ [NPM_HREF]: https://www.npmjs.com/package/ftconfig

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc