A node module to decode/encode a Miscreated hosting.cfg file.
$ npm install --save mis-configurator
import {
createHostingCFGStringFromObject,
createObjectFromHostingCFGString
} from 'mis-configurator';
const hostingCFGString = createHostingCFGStringFromObject(mockHostingCFGObj);
const hostingCFGObj = createObjectFromHostingCFGString(mockHostingCFgString);
MisConfigurator project: mis-configurator author: Chris Sprance - csprance
Encode and decode Miscreated hosting.cfg files decode to get a simple js object / encode to get a config-String
Parameters
options
MisConfiguratorOptions (optional, defaultdefaultOptions
)
Meta
- author: Csprance - Based off of config-cfg-ini
Decode a config-string
Parameters
data
string {string}
Returns Object object
Encode an object no nesting section supported!
Parameters
object
Object {object}
Returns string
Gets any keys that are duplicates
- @param keyValuePairs [['key1'], 'value1'], ['key2', 'value2'], ['key1', 'value3']]
Parameters
Returns Array<string> Array ['key1']
Try to detect the used line ending (windows, unix, mac)
Parameters
data
string
Returns string string
Figures out if a string begins with one of the string (windows, unix, mac)
Parameters
Returns boolean string
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.
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
MIT © csprance