# posthtml-spaceless **Repository Path**: mirrors_posthtml/posthtml-spaceless ## Basic Information - **Project Name**: posthtml-spaceless - **Description**: Spaceless tag to remove whitespace between HTML tags - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-25 - **Last Updated**: 2025-09-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # posthtml-spaceless > A [posthtml](https://github.com/posthtml) plugin remove whitespace between HTML tags [](https://travis-ci.org/posthtml/posthtml-spaceless)[](https://ci.appveyor.com/project/posthtml/posthtml-spaceless)[]()[](https://www.npmjs.com/package/posthtml-spaceless)[](https://david-dm.org/posthtml/posthtml-spaceless)[](https://github.com/sindresorhus/xo)[](https://coveralls.io/r/posthtml/posthtml-spaceless) [](https://www.npmjs.com/package/posthtml-spaceless)[](https://www.npmjs.com/package/posthtml-spaceless) ## Why? This 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). ## Install ```bash npm i -D posthtml posthtml-spaceless ``` > **Note:** This project is compatible with node v4+ ## Usage ```js import {readFileSync, writeFileSync} from 'fs'; import posthtml from 'posthtml'; import spaceless from 'posthtml-spaceless'; const html = readFileSync('input.html', 'utf8'); posthtml() .use(spaceless()) .process(html) .then(result => { writeFileSync('output.html', result.html); }); ``` *Returns the html without whitespace between tags* ## Example #### input.html ```html