{"id":22824489,"url":"https://github.com/csprance/mis-configurator","last_synced_at":"2025-03-31T00:19:25.536Z","repository":{"id":57298299,"uuid":"123033364","full_name":"csprance/mis-configurator","owner":"csprance","description":"A module to convert a Javascript object to a hosting.cfg file or vice a versa for Miscreated game servers","archived":false,"fork":false,"pushed_at":"2018-02-28T00:36:44.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T07:48:55.255Z","etag":null,"topics":["miscreated"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csprance.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-26T21:32:56.000Z","updated_at":"2018-02-28T19:43:14.000Z","dependencies_parsed_at":"2022-09-06T03:31:44.659Z","dependency_job_id":null,"html_url":"https://github.com/csprance/mis-configurator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csprance%2Fmis-configurator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csprance%2Fmis-configurator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csprance%2Fmis-configurator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csprance%2Fmis-configurator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csprance","download_url":"https://codeload.github.com/csprance/mis-configurator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246396416,"owners_count":20770366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["miscreated"],"created_at":"2024-12-12T17:07:25.066Z","updated_at":"2025-03-31T00:19:25.500Z","avatar_url":"https://github.com/csprance.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mis-configurator\n\n[![NPM version](https://img.shields.io/npm/v/mis-configurator.svg?style=flat-square)](https://npmjs.org/package/mis-configurator)\n\n\u003e A node module to decode/encode a Miscreated hosting.cfg file.\n\n## Install\n\n    $ npm install --save mis-configurator\n\n## Usage\n\n```js\nimport {\n\tcreateHostingCFGStringFromObject,\n\tcreateObjectFromHostingCFGString\n} from 'mis-configurator';\n\nconst hostingCFGString = createHostingCFGStringFromObject(mockHostingCFGObj);\nconst hostingCFGObj = createObjectFromHostingCFGString(mockHostingCFgString);\n```\n\n## API\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n#### Table of Contents\n\n-   [saneDefaults](#sanedefaults)\n-   [MisConfigurator](#misconfigurator)\n    -   [decode](#decode)\n    -   [encode](#encode)\n    -   [getDuplicatedKeys](#getduplicatedkeys)\n    -   [detectLineEnding](#detectlineending)\n    -   [stringBeginsWithOnOfTheseStrings](#stringbeginswithonofthesestrings)\n-   [createHostingCFGStringFromObject](#createhostingcfgstringfromobject)\n-   [createObjectFromHostingCFGString](#createobjectfromhostingcfgstring)\n\n### saneDefaults\n\nMisConfigurator\nproject: mis-configurator\nauthor: Chris Sprance - csprance\n\n### MisConfigurator\n\nEncode and decode Miscreated hosting.cfg files\ndecode to get a simple js object / encode to get a config-String\n\n**Parameters**\n\n-   `options` **MisConfiguratorOptions**  (optional, default `defaultOptions`)\n\n**Meta**\n\n-   **author**: Csprance - Based off of config-cfg-ini\n\n#### decode\n\nDecode a config-string\n\n**Parameters**\n\n-   `data` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** {string}\n\nReturns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** object\n\n#### encode\n\nEncode an object\nno nesting section supported!\n\n**Parameters**\n\n-   `object` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** {object}\n\nReturns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \n\n#### getDuplicatedKeys\n\nGets any keys that are duplicates\n\n-   @param keyValuePairs \\[['key1'], 'value1'], ['key2', 'value2'], ['key1', 'value3']]\n\n**Parameters**\n\n-   `keyValuePairs` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e\u003e** \n\nReturns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e** Array\u003cstring\u003e ['key1']\n\n#### detectLineEnding\n\nTry to detect the used line ending\n(windows, unix, mac)\n\n**Parameters**\n\n-   `data` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \n\nReturns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** string\n\n#### stringBeginsWithOnOfTheseStrings\n\nFigures out if a string begins with one of the string\n(windows, unix, mac)\n\n**Parameters**\n\n-   `string` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** \n-   `stringList` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\u0026lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\u003e** \n\nReturns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** string\n\n### createHostingCFGStringFromObject\n\nThis takes a javascript object and transforms it to a hosting.cfg string.\n\n**Parameters**\n\n-   `data` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** The javascript object to transform.\n\nReturns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** a hosting.cfg string.\n\n### createObjectFromHostingCFGString\n\nThis takes a hosting.cfg string and transforms it to a javascript object\n\n**Parameters**\n\n-   `str` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The string hosting.cfg to transform.\n\nReturns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** a javascript object\n\n## License\n\nMIT © [csprance](https://github.com/csprance)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsprance%2Fmis-configurator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsprance%2Fmis-configurator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsprance%2Fmis-configurator/lists"}