0.3.0 • Published 6 years ago

mis-configurator v0.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

mis-configurator

NPM version

A node module to decode/encode a Miscreated hosting.cfg file.

Install

$ npm install --save mis-configurator

Usage

import {
	createHostingCFGStringFromObject,
	createObjectFromHostingCFGString
} from 'mis-configurator';

const hostingCFGString = createHostingCFGStringFromObject(mockHostingCFGObj);
const hostingCFGObj = createObjectFromHostingCFGString(mockHostingCFgString);

API

Table of Contents

saneDefaults

MisConfigurator project: mis-configurator author: Chris Sprance - csprance

MisConfigurator

Encode and decode Miscreated hosting.cfg files decode to get a simple js object / encode to get a config-String

Parameters

  • options MisConfiguratorOptions (optional, default defaultOptions)

Meta

  • author: Csprance - Based off of config-cfg-ini

decode

Decode a config-string

Parameters

Returns Object object

encode

Encode an object no nesting section supported!

Parameters

Returns string

getDuplicatedKeys

Gets any keys that are duplicates

Parameters

Returns Array<string> Array 'key1'

detectLineEnding

Try to detect the used line ending (windows, unix, mac)

Parameters

Returns string string

stringBeginsWithOnOfTheseStrings

Figures out if a string begins with one of the string (windows, unix, mac)

Parameters

Returns boolean string

createHostingCFGStringFromObject

This takes a javascript object and transforms it to a hosting.cfg string.

Parameters

  • data Object The javascript object to transform.

Returns string a hosting.cfg string.

createObjectFromHostingCFGString

This takes a hosting.cfg string and transforms it to a javascript object

Parameters

  • str string The string hosting.cfg to transform.

Returns Object a javascript object

License

MIT © csprance