{"id":17149537,"url":"https://github.com/mohd-akram/html-format","last_synced_at":"2025-04-13T11:43:14.380Z","repository":{"id":46804344,"uuid":"132627524","full_name":"mohd-akram/html-format","owner":"mohd-akram","description":"A Node.js library for formatting HTML strings","archived":false,"fork":false,"pushed_at":"2024-05-31T08:27:56.000Z","size":98,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-18T19:02:55.926Z","etag":null,"topics":["html-format","node","nodejs","npm"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/html-format","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/mohd-akram.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-08T15:18:09.000Z","updated_at":"2024-10-10T08:12:13.000Z","dependencies_parsed_at":"2023-12-19T22:01:12.030Z","dependency_job_id":"a9c43cfc-9cac-4771-94c6-27a4176339bc","html_url":"https://github.com/mohd-akram/html-format","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohd-akram%2Fhtml-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohd-akram%2Fhtml-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohd-akram%2Fhtml-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohd-akram%2Fhtml-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohd-akram","download_url":"https://codeload.github.com/mohd-akram/html-format/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240072083,"owners_count":19743527,"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-format","node","nodejs","npm"],"created_at":"2024-10-14T21:33:23.133Z","updated_at":"2025-02-23T09:31:55.271Z","avatar_url":"https://github.com/mohd-akram.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# html-format\n\nFormat HTML strings by indenting, wrapping, and removing unnecessary\nwhitespace while preserving newlines.\n\n## Install\n\n    npm install html-format\n\n## Usage\n\n```javascript\nimport format from \"html-format\";\n\nconst html = `\\\n\u003cbody\u003e\n\u003cmain class=\"grid\"\u003e   \u003c/main\u003e\n\u003c/body\u003e\n`;\n\n// indent = 2 spaces (default), width = 80 characters (default)\nformat(html) ==\n  `\\\n\u003cbody\u003e\n  \u003cmain class=\"grid\"\u003e \u003c/main\u003e\n\u003c/body\u003e\n`;\n\n// indent = 4 spaces, width = 80 characters (default)\nformat(html, \" \".repeat(4)) ==\n  `\\\n\u003cbody\u003e\n    \u003cmain class=\"grid\"\u003e \u003c/main\u003e\n\u003c/body\u003e\n`;\n\n// indent = 4 spaces, width = 20 characters\nformat(html, \" \".repeat(4), 20) ==\n  `\\\n\u003cbody\u003e\n    \u003cmain\n        class=\"grid\"\u003e\n    \u003c/main\u003e\n\u003c/body\u003e\n`;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohd-akram%2Fhtml-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohd-akram%2Fhtml-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohd-akram%2Fhtml-format/lists"}