{"id":15672924,"url":"https://github.com/vpj/weya","last_synced_at":"2025-05-06T22:08:40.272Z","repository":{"id":15163852,"uuid":"17891543","full_name":"vpj/weya","owner":"vpj","description":"Simple Typescript/Javascript framework for DOM manipulation","archived":false,"fork":false,"pushed_at":"2022-08-25T09:36:33.000Z","size":117,"stargazers_count":15,"open_issues_count":1,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-06T22:08:30.290Z","etag":null,"topics":["dom-manipulation","html","typescript","ui-template"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/vpj.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":"2014-03-19T03:51:18.000Z","updated_at":"2022-11-08T21:33:37.000Z","dependencies_parsed_at":"2022-09-14T21:20:26.169Z","dependency_job_id":null,"html_url":"https://github.com/vpj/weya","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpj%2Fweya","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpj%2Fweya/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpj%2Fweya/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpj%2Fweya/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vpj","download_url":"https://codeload.github.com/vpj/weya/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252776581,"owners_count":21802468,"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":["dom-manipulation","html","typescript","ui-template"],"created_at":"2024-10-03T15:33:37.816Z","updated_at":"2025-05-06T22:08:40.231Z","avatar_url":"https://github.com/vpj.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🐜 Weya\n\nWeya is a lightweight library for DOM manipulation.\n\nHere's a small example to show the usage.\n\n```typescript\nlet userElems = []\n$('div', '.users', document.body, $ =\u003e {\n    for (let i = 0; i \u003c users.length; ++i) {\n        let userDiv = $('div', '.user', { on: { click: editUser } }, $ =\u003e {\n            let name = $('span', '.name', users[i])\n            let phone = $(\"span', '.phone\", phones[i])\n        });\n        (\u003cany\u003euserDiv).userId = i\n        userElems.push({ user: users[i], div: userDiv })\n    }\n})\n```\n\nThe above code creates a list of users. It binds the data to the dom element `userDiv.userId = i` and also keeps track of all the DOM elements in `userElems`. This is important if you want to manipulate the DOM without reloading the entire user list, for example if a name of a user changes you could change it with `userElems[changedUserId].name.textContent = changedUserName`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpj%2Fweya","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvpj%2Fweya","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpj%2Fweya/lists"}