{"id":21935356,"url":"https://github.com/zeecoder/z-dom-config","last_synced_at":"2026-05-13T05:35:09.843Z","repository":{"id":33545790,"uuid":"37191950","full_name":"ZeeCoder/z-dom-config","owner":"ZeeCoder","description":"A solution to load JSON configuration from DOM attributes.","archived":false,"fork":false,"pushed_at":"2015-08-18T14:11:59.000Z","size":196,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-27T13:14:15.600Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ZeeCoder.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":"2015-06-10T10:58:10.000Z","updated_at":"2015-06-10T11:31:05.000Z","dependencies_parsed_at":"2022-08-07T22:00:52.648Z","dependency_job_id":null,"html_url":"https://github.com/ZeeCoder/z-dom-config","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeeCoder%2Fz-dom-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeeCoder%2Fz-dom-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeeCoder%2Fz-dom-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeeCoder%2Fz-dom-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZeeCoder","download_url":"https://codeload.github.com/ZeeCoder/z-dom-config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244966462,"owners_count":20539794,"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":[],"created_at":"2024-11-29T00:19:44.537Z","updated_at":"2026-05-13T05:35:09.812Z","avatar_url":"https://github.com/ZeeCoder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# z-dom-config\n[![Build Status](https://travis-ci.org/ZeeCoder/z-dom-config.svg?branch=master)](https://travis-ci.org/ZeeCoder/z-dom-config)\n[![npm version](https://badge.fury.io/js/z-dom-config.svg)](http://badge.fury.io/js/z-dom-config)\n\nThis module helps loading JSON configuration from `data-*` attributes.\n\nSince it's a CommonJS module, it must be used alongside with [Browserify](http://browserify.org/), or\nsomething similar, like [WebPacker](http://webpack.github.io/).\n\n## Example, explanation\n\n```html\n\u003c!-- The DOM element we want to extract the configuration from --\u003e\n\u003cdiv\n    id=\"target-element\"\n    data-configuration='{\n        \"bool_value\": false\n    }'\n\u003e\u003c/div\u003e\n```\n\n```js\nvar dom_config = require('z-dom-config');\n\n// Loads and parses the \"data-configuration\" attribute, then deep-merges the\n// results with the object given as the default configuration if given.\n// Note: If the string is not a valid JSON string, then a console error is shown\n// and an empty object will be used instead of the attribute's contents.\ndom_config.load(\n    // jQuery is optional, it works with `document.getElementById('target-element')` too\n    $('#target-element'),\n    'configuration',\n    {\n        bool_value: true,\n        something_else: 42\n    }\n);\n// -\u003e {bool_value: false, something_else: 42}\n```\n\n## License\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeecoder%2Fz-dom-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeecoder%2Fz-dom-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeecoder%2Fz-dom-config/lists"}