{"id":29056745,"url":"https://github.com/towerofnix/fix-whitespace","last_synced_at":"2025-06-27T05:42:12.016Z","repository":{"id":57237652,"uuid":"88368105","full_name":"towerofnix/fix-whitespace","owner":"towerofnix","description":"A tiny library that fixes whitespace in JavaScript template strings.","archived":false,"fork":false,"pushed_at":"2021-02-02T20:25:42.000Z","size":13,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-26T07:21:39.944Z","etag":null,"topics":["es6","string","string-modification","template-strings","whitespace"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/fix-whitespace","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/towerofnix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-15T18:57:13.000Z","updated_at":"2021-02-02T20:25:44.000Z","dependencies_parsed_at":"2022-08-26T14:04:21.687Z","dependency_job_id":null,"html_url":"https://github.com/towerofnix/fix-whitespace","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/towerofnix/fix-whitespace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/towerofnix%2Ffix-whitespace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/towerofnix%2Ffix-whitespace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/towerofnix%2Ffix-whitespace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/towerofnix%2Ffix-whitespace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/towerofnix","download_url":"https://codeload.github.com/towerofnix/fix-whitespace/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/towerofnix%2Ffix-whitespace/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262201290,"owners_count":23274333,"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":["es6","string","string-modification","template-strings","whitespace"],"created_at":"2025-06-27T05:42:08.014Z","updated_at":"2025-06-27T05:42:11.999Z","avatar_url":"https://github.com/towerofnix.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fix-whitespace\n\nA tiny library that fixes whitespace in JavaScript template strings.\n\n```js\nconst items = [1, 2, 3]\n\nconst generateSitePage = (head, content) =\u003e fixWhitespace`\n  \u003c!DOCTYPE html\u003e\n  \u003chtml\u003e\n    \u003chead\u003e\n      (Begin head..)${head}(..End head)\n      \u003cmeta charset='utf-8'\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n      \u003cdiv id='content'\u003e\n        ${\"Early insert!\"} (Begin content x1..)${content}(..end content; begin content x2..)${content}(..end content!)\n        ${\"And back down.\"}\n      \u003c/div\u003e\n    \u003c/body\u003e\n  \u003c/html\u003e\n`\n\nconsole.log(generateSitePage(\n  fixWhitespace`\n    \u003ctitle\u003eHello, world!\u003c/title\u003e\n  `,\n\n  fixWhitespace`\n    \u003cul\u003e${items.map(x =\u003e `\u003cli\u003e${x}\u003c/li\u003e`).join('\\n')}\u003c/ul\u003e\n  `\n))\n```\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    (Begin head..)\u003ctitle\u003eHello, world!\u003c/title\u003e(..End head)\n    \u003cmeta charset='utf-8'\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdiv id='content'\u003e\n      Early insert! (Begin content x1..)\u003cul\u003e\n        \u003cli\u003e1\u003c/li\u003e\n        \u003cli\u003e2\u003c/li\u003e\n        \u003cli\u003e3\u003c/li\u003e\n      \u003c/ul\u003e\n        \u003c!-- Further indent at end! --\u003e(..end content; begin content x2..)\u003cul\u003e\n          \u003cli\u003e1\u003c/li\u003e\n          \u003cli\u003e2\u003c/li\u003e\n          \u003cli\u003e3\u003c/li\u003e\n        \u003c/ul\u003e\n          \u003c!-- Further indent at end! --\u003e(..end content!)\n      And back down.\n    \u003c/div\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Documentation\n\n[Read the code!](fix-whitespace.js)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftowerofnix%2Ffix-whitespace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftowerofnix%2Ffix-whitespace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftowerofnix%2Ffix-whitespace/lists"}