{"id":15070105,"url":"https://github.com/russellsteadman/docile","last_synced_at":"2026-03-11T10:05:54.709Z","repository":{"id":43001971,"uuid":"118144242","full_name":"russellsteadman/docile","owner":"russellsteadman","description":"Docile makes it easy to store and retrieve data about DOM nodes.","archived":false,"fork":false,"pushed_at":"2023-01-04T01:20:21.000Z","size":2816,"stargazers_count":0,"open_issues_count":16,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-12T09:40:15.680Z","etag":null,"topics":["attributes","dom","dom-node","html","javascript","node"],"latest_commit_sha":null,"homepage":"https://docile.js.org/","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/russellsteadman.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-01-19T15:44:39.000Z","updated_at":"2023-03-17T12:10:26.000Z","dependencies_parsed_at":"2023-02-01T17:31:02.832Z","dependency_job_id":null,"html_url":"https://github.com/russellsteadman/docile","commit_stats":null,"previous_names":["teamtofu/docile"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/russellsteadman/docile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russellsteadman%2Fdocile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russellsteadman%2Fdocile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russellsteadman%2Fdocile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russellsteadman%2Fdocile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/russellsteadman","download_url":"https://codeload.github.com/russellsteadman/docile/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russellsteadman%2Fdocile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30377838,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["attributes","dom","dom-node","html","javascript","node"],"created_at":"2024-09-25T01:48:05.785Z","updated_at":"2026-03-11T10:05:54.692Z","avatar_url":"https://github.com/russellsteadman.png","language":"JavaScript","funding_links":["https://www.paypal.me/RussellSteadman/3"],"categories":[],"sub_categories":[],"readme":"# Docile\n\nDocile makes it easy to store and retrieve data about DOM nodes.\n\n## Installation\n\nWith NPM\n\n```bash\n$ npm i -S docile\n```\n\nWith Yarn\n\n```bash\n$ yarn add docile\n```\n\nWith a CDN\n\n```html\n\u003cscript src=\"https://unpkg.com/docile@latest/dist/docile.js\"\u003e\u003c/script\u003e\n```\n\nWith Bower\n\n```bash\n$ bower install -S docile\n```\n\n## Example Usage\n\n```html\n\u003cbody\u003e\n  \u003cdiv id=\"foo\"\u003eFoo\u003c/div\u003e\n\u003c/body\u003e\n```\n\n```js\nvar Docile = require(\"docile\");\n\nDocile.set(document.body, { example: [\"a\", \"b\"] }); // set data for DOM node (body)\nDocile.get(document.body); // get data for DOM node (body)\n// -\u003e {example: ['a', 'b']}\n\nDocile.set(\"foo\", { bar: true }); // set data for DOM node with ID 'foo'\nDocile.get(document.getElementById(\"foo\")); // get data for DOM node (foo)\n// -\u003e {bar: true}\n\nvar fooLink = Docile.link(\"foo\"); // get linkInstance for DOM node with ID 'foo'\n\nfooLink.set(\"baz\", document.body); // have baz link to DOM node (body) for DOM node (foo)\nfooLink.set({ yum: document.body }); // have yum link to DOM node (body) for DOM node (foo)\n\nfooLink.get(\"yum\"); // get the yum link for DOM node (foo)\n// -\u003e DOM Node (body)\nfooLink.get(); // get all links for DOM node (foo)\n// -\u003e {baz: DOM Node (body), yum: DOM Node (body)}\n\nfooLink.getData(\"yum\"); // get the data for the yum link for DOM node (foo)\n// -\u003e {example: ['a', 'b']}\nfooLink.getData(); // get the data for all links for DOM node (foo)\n// -\u003e {baz: {example: ['a', 'b']}, yum: {example: ['a', 'b']}}\n```\n\n## Documentation\n\nDocile is super simple to use.\n\n### Methods\n\n#### Docile.set\n\nPurpose: to store information about a node\n\nThe set method accepts two parameters: a node and the data to be stored. The node can either be a DOM node, or it can be an ID to a DOM Node.\n\n```js\nDocile.set(node, data);\n```\n\n#### Docile.get\n\nPurpose: to retrieve information about a node\n\nThe get method accepts one parameter: a node. The node can either be a DOM node, or it can be an ID to a DOM Node. This method returns the value stored with the set method.\n\n```js\nDocile.get(node);\n```\n\n#### Docile.link\n\nPurpose: to create a linkInstance for a node\n\nThe link method accepts one parameter: a node. The node can either be a DOM node, or it can be an ID to a DOM Node. This method returns a link instance.\n\n```js\nvar linkInstance = Docile.link(node);\n```\n\n##### linkInstance.set\n\nPurpose: to \"link\" a given node to other nodes\n\nThe set method accepts two parameters: an alias string and a node. The node can either be a DOM node, or it can be an ID to a DOM Node. To set multiple links at one time, the set method also accepts an object with aliases mapped to nodes.\n\n```js\nlinkInstance.set(alias, node);\n// OR\nlinkInstance.set(aliasToNodeObject);\n```\n\n##### linkInstance.get\n\nPurpose: to retrieve \"links\"\n\nThe get method accepts one parameter: an alias. It returns a DOM node. If no alias is passed, then an object with aliases mapped to nodes will be returned.\n\n```js\nlinkInstance.get(alias);\n// OR\nlinkInstance.get();\n```\n\n##### linkInstance.getData\n\nPurpose: to retrieve data from \"links\"\n\nThe getData method accepts one parameter: an alias. It returns the data from the corresponding link. If no alias is passed, then an object with aliases mapped to data will be returned.\n\n```js\nlinkInstance.getData(alias);\n// OR\nlinkInstance.getData();\n```\n\n## Testing\n\nDocile is tested using Jasmine. The test of the minified packages is available [here](https://docile.js.org/test/index.html) and the webpack package [here](https://docile.js.org/test/webpack.html).\n\n### Big Thanks\n\n[![Sauce Labs](https://docile.js.org/test/sauce/saucelabs.png)](https://saucelabs.com/)\n\nCross-browser Testing Platform and Open Source \u003c3 Provided by [Sauce Labs](https://saucelabs.com/)!\n\n## License\n\nMIT (C) [Russell Steadman](https://russellsteadman.github.io/contact). Learn more in the [LICENSE](https://github.com/russellsteadman/docile/blob/master/LICENSE) file.\n\n## Support Me\n\nLike this project? Buy me a [cup of coffee](https://www.paypal.me/RussellSteadman/3). \u0026#x2615; Here are more of my [projects](https://russellsteadman.github.io/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frussellsteadman%2Fdocile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frussellsteadman%2Fdocile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frussellsteadman%2Fdocile/lists"}