{"id":21589286,"url":"https://github.com/raml2html/raml2obj","last_synced_at":"2025-03-31T08:08:48.766Z","repository":{"id":517435,"uuid":"20785418","full_name":"raml2html/raml2obj","owner":"raml2html","description":"RAML to object.","archived":false,"fork":false,"pushed_at":"2023-03-04T02:27:32.000Z","size":423,"stargazers_count":23,"open_issues_count":11,"forks_count":45,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-03-24T04:11:33.947Z","etag":null,"topics":["raml","raml-tooling","raml-utilities","raml2html"],"latest_commit_sha":null,"homepage":"https://www.npmjs.org/package/raml2obj","language":"JavaScript","has_issues":false,"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/raml2html.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-06-12T22:52:24.000Z","updated_at":"2025-01-25T18:57:26.000Z","dependencies_parsed_at":"2023-07-06T12:31:50.452Z","dependency_job_id":null,"html_url":"https://github.com/raml2html/raml2obj","commit_stats":{"total_commits":167,"total_committers":20,"mean_commits":8.35,"dds":0.6706586826347305,"last_synced_commit":"dc91e6ec638c64d30e66f85d22d3aa54fe5c1fe5"},"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raml2html%2Framl2obj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raml2html%2Framl2obj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raml2html%2Framl2obj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raml2html%2Framl2obj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raml2html","download_url":"https://codeload.github.com/raml2html/raml2obj/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246436390,"owners_count":20776995,"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":["raml","raml-tooling","raml-utilities","raml2html"],"created_at":"2024-11-24T16:13:50.356Z","updated_at":"2025-03-31T08:08:48.727Z","avatar_url":"https://github.com/raml2html.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RAML to object\n\n[![NPM version](http://img.shields.io/npm/v/raml2obj.svg)](https://www.npmjs.org/package/raml2obj)\n[![Prettier](https://img.shields.io/badge/code%20style-prettier-blue.svg?style=flat)](https://github.com/prettier/prettier)\n\nA thin wrapper around [raml-js-parser-2](https://github.com/raml-org/raml-js-parser-2), adding extra properties to the resulting\nobject for use in [raml2html](https://www.npmjs.org/package/raml2html) and [raml2md](https://www.npmjs.org/package/raml2md).\n\nVersions 4.0.0 and up only support RAML 1.x files. If you still have RAML 0.8 source files, please stick with raml2obj 3.\n\n## Install\n```\nnpm i raml2obj --save\n```\n\n## Usage\n```js\nvar raml2obj = require('raml2obj');\n\n// source can either be a filename, url, or parsed RAML object.\n// Returns a promise.\nraml2obj.parse(source).then(function(ramlObj) {\n  // Do something with the resulting ramlObj :)\n});\n```\n\n## Options\nThe `parse()` function can be called with options to customize the result. \nDefaults are compatible with `raml2html`.\n\n```js\nraml2obj.parse(source, {\n  validate: true, \n  extensionsAndOverlays : [], \n  collectionFormat: 'arrays',\n}).then(function(ramlObj) {\n  // Do something with the resulting ramlObj :)\n});\n```\n * `validate`: triggers the `rejectOnErrors` flag of the underlying parser. defaults to `false`\n * `extensionsAndOverlays`:  Defaults to `[]`. See parser documentation.\n * `collectionFormat`: choose what data structure the double-nested `[{name1: {..}}, {name2: {..}}]` patterns of the `raml-1-parser` are transformed to in the output object:\n  \n| `collectionFormat` value | output |\n| --- | --- |\n|`objects` (*default*)|`{name1: { orderHint: 0, ..}, name2: { orderHint: 1, ..}}`  (eases e.g. property access). *Applies to top-level collections only, nested are arrays except type properties.*|\n|`arrays`|`[ {key: \"name1\", ..}, {key: \"name2\", ..}]`  (eases e.g. representation in a database). *Applies recursively everywhere.* |\n\n\n## Questions \u0026 Support\nDo you have a question? Have you found a bug or would you like to request a feature? Please check out [`CONTRIBUTING.md`](CONTRIBUTING.md).\n\n\n## License\nraml2obj is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framl2html%2Framl2obj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framl2html%2Framl2obj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framl2html%2Framl2obj/lists"}