{"id":24983652,"url":"https://github.com/posthtml/posthtml-spaceless","last_synced_at":"2025-04-11T20:51:36.948Z","repository":{"id":57328863,"uuid":"79330156","full_name":"posthtml/posthtml-spaceless","owner":"posthtml","description":"Spaceless tag to remove whitespace between HTML tags","archived":false,"fork":false,"pushed_at":"2017-12-13T13:25:30.000Z","size":95,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-29T21:06:07.598Z","etag":null,"topics":["html","plugin","posthtml","posthtml-plugin","spaceless"],"latest_commit_sha":null,"homepage":"","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/posthtml.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","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":"2017-01-18T10:38:58.000Z","updated_at":"2023-12-18T02:58:01.000Z","dependencies_parsed_at":"2022-09-13T06:03:15.398Z","dependency_job_id":null,"html_url":"https://github.com/posthtml/posthtml-spaceless","commit_stats":null,"previous_names":["gitscrum/posthtml-spaceless"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-spaceless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-spaceless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-spaceless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-spaceless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posthtml","download_url":"https://codeload.github.com/posthtml/posthtml-spaceless/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248304940,"owners_count":21081551,"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","plugin","posthtml","posthtml-plugin","spaceless"],"created_at":"2025-02-04T09:20:02.871Z","updated_at":"2025-04-11T20:51:36.915Z","avatar_url":"https://github.com/posthtml.png","language":"JavaScript","readme":"# posthtml-spaceless\n\n\u003e A [posthtml](https://github.com/posthtml) plugin remove whitespace between HTML tags\n\n[![Travis Build Status](https://img.shields.io/travis/posthtml/posthtml-spaceless.svg?style=flat-square\u0026label=unix)](https://travis-ci.org/posthtml/posthtml-spaceless)[![AppVeyor Build Status](https://img.shields.io/appveyor/ci/GitScrum/posthtml-spaceless.svg?style=flat-square\u0026label=windows)](https://ci.appveyor.com/project/posthtml/posthtml-spaceless)[![node](https://img.shields.io/node/v/post-sequence.svg?maxAge=2592000\u0026style=flat-square)]()[![npm version](https://img.shields.io/npm/v/posthtml-spaceless.svg?style=flat-square)](https://www.npmjs.com/package/posthtml-spaceless)[![Dependency Status](https://david-dm.org/gitscrum/posthtml-spaceless.svg?style=flat-square)](https://david-dm.org/posthtml/posthtml-spaceless)[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg?style=flat-square)](https://github.com/sindresorhus/xo)[![Coveralls status](https://img.shields.io/coveralls/posthtml/posthtml-spaceless.svg?style=flat-square)](https://coveralls.io/r/posthtml/posthtml-spaceless)\n\n[![npm downloads](https://img.shields.io/npm/dm/posthtml-spaceless.svg?style=flat-square)](https://www.npmjs.com/package/posthtml-spaceless)[![npm](https://img.shields.io/npm/dt/posthtml-spaceless.svg?style=flat-square)](https://www.npmjs.com/package/posthtml-spaceless)\n\n## Why?\nThis tag is based on and compatible with the [Twig `spaceless` tag](http://twig.sensiolabs.org/doc/tags/spaceless.html), [Swig `spaceless` tag](https://voorhoede.github.io/swig/docs/tags/#spaceless) and [Django `spaceless` tag](https://docs.djangoproject.com/en/dev/ref/templates/builtins/#spaceless).\n\n## Install\n\n```bash\nnpm i -D posthtml posthtml-spaceless\n```\n\n\u003e **Note:** This project is compatible with node v4+\n\n## Usage\n\n```js\nimport {readFileSync, writeFileSync} from 'fs';\nimport posthtml from 'posthtml';\nimport spaceless from 'posthtml-spaceless';\n\nconst html = readFileSync('input.html', 'utf8');\n\nposthtml()\n    .use(spaceless())\n    .process(html)\n    .then(result =\u003e {\n        writeFileSync('output.html', result.html);\n    });\n\n```\n*Returns the html without whitespace between tags*\n\n## Example\n\n#### input.html\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n    \u003chead\u003e\u003c/head\u003e\n    \u003cbody\u003e\n        \u003ch2\u003eHeader\u003c/h2\u003e\n        \u003cspaceless\u003e\n        \u003cul\u003e\n            \u003cli\u003eone\u003c/li\u003e\n            \u003cli\u003etwo\u003c/li\u003e\n            \u003cli\u003ethree\u003c/li\u003e\n        \u003c/ul\u003e\n        \u003c/spaceless\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### output.html\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n    \u003chead\u003e\u003c/head\u003e\n    \u003cbody\u003e\n        \u003ch2\u003eHeader\u003c/h2\u003e\n        \u003cul\u003e\u003cli\u003eone\u003c/li\u003e\u003cli\u003etwo\u003c/li\u003e\u003cli\u003ethree\u003c/li\u003e\u003c/ul\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-spaceless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposthtml%2Fposthtml-spaceless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-spaceless/lists"}