{"id":19819287,"url":"https://github.com/minoritea/nanowire","last_synced_at":"2026-05-11T09:08:28.973Z","repository":{"id":56719562,"uuid":"520891768","full_name":"minoritea/nanowire","owner":"minoritea","description":"A minimal DOM patcher for HTML-over-the-wire","archived":false,"fork":false,"pushed_at":"2022-08-17T16:59:43.000Z","size":132,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-12T12:56:29.694Z","etag":null,"topics":["html","html-over-the-wire","html-renderer","javascript","typescript"],"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/minoritea.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":"2022-08-03T13:28:29.000Z","updated_at":"2023-08-25T17:08:56.000Z","dependencies_parsed_at":"2022-08-16T00:10:49.491Z","dependency_job_id":null,"html_url":"https://github.com/minoritea/nanowire","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minoritea%2Fnanowire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minoritea%2Fnanowire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minoritea%2Fnanowire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minoritea%2Fnanowire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minoritea","download_url":"https://codeload.github.com/minoritea/nanowire/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241176621,"owners_count":19922732,"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":["html","html-over-the-wire","html-renderer","javascript","typescript"],"created_at":"2024-11-12T10:18:28.004Z","updated_at":"2026-05-11T09:08:28.895Z","avatar_url":"https://github.com/minoritea.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nanowire\nNanowire is a minimal DOM patcher for HTML-over-the-wire.\n\n# How to use\n1. Enclose the element to be updated in a `\u003cnw-frame\u003e` tag with a unique ID.\n2. Give the following arguments to the `apply` function,\n    1. The DOM node or document that is the ancestor of the \"nw-frame\" tags to be updated,\n    2. Text containing \"nw-frame\" tags surrounding updates.\n\nThe following HTML is displayed first,\n```html\n\u003cnw-frame id=\"frame\"\u003e\nHello?\n\u003c/nw-frame\u003e\n```\n\nand then the following code is executed,\n\n```javascript\nimport { apply } from 'nanowire';\napply(document, '\u003cnw-frame id=\"frame\"\u003eHello, World!\u003c/nw-frame\u003e');\n```\n\nthe result is as follows.\n```html\n\u003cnw-frame id=\"frame\"\u003e\nHello, World!\n\u003c/nw-frame\u003e\n```\n\nYou can apply server-side rendered HTML as updates.\n```javascript\nfetch('your API').then(res =\u003e res.text()).then(text =\u003e apply(document, text));\n```\n\nThe `nanowire/client` module provides short hands for fetch and apply.\n```html\n\u003cscript src=\"https://unpkg.com/nanowire/dist/client.js\"\u003e\u003c/script\u003e\n\n\u003cbutton onClick=\"nanowire.get('your API')\"\u003eGET\u003c/button\u003e\n\n\u003cbutton onClick=\"nanowire.post('your API', JSON.stringify(['request body']))\"\u003ePOST\u003c/button\u003e\n```\n\n# Example\n\nSee the example.\n```shell\n# clone this repository and move inside.\n$ cd example\n$ yarn serve\n```\n\n# LICENSE\nMIT License(see LICENSE file).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminoritea%2Fnanowire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminoritea%2Fnanowire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminoritea%2Fnanowire/lists"}