{"id":21540946,"url":"https://github.com/reshape/beautify","last_synced_at":"2025-07-05T14:34:45.425Z","repository":{"id":57147054,"uuid":"66387655","full_name":"reshape/beautify","owner":"reshape","description":"a reshape plugin that pretty-prints your html","archived":false,"fork":false,"pushed_at":"2019-02-05T12:45:43.000Z","size":23,"stargazers_count":9,"open_issues_count":9,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-13T20:53:30.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reshape.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-23T17:18:09.000Z","updated_at":"2021-09-13T08:56:22.000Z","dependencies_parsed_at":"2022-09-06T12:52:26.724Z","dependency_job_id":null,"html_url":"https://github.com/reshape/beautify","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/reshape/beautify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reshape%2Fbeautify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reshape%2Fbeautify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reshape%2Fbeautify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reshape%2Fbeautify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reshape","download_url":"https://codeload.github.com/reshape/beautify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reshape%2Fbeautify/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263755760,"owners_count":23506446,"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":[],"created_at":"2024-11-24T05:00:36.674Z","updated_at":"2025-07-05T14:34:45.381Z","avatar_url":"https://github.com/reshape.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reshape Beautify\n\n[![npm](https://img.shields.io/npm/v/reshape-beautify.svg?style=flat-square)](https://npmjs.com/package/reshape-beautify)\n[![tests](https://img.shields.io/travis/reshape/beautify.svg?style=flat-square)](https://travis-ci.org/reshape/beautify?branch=master)\n[![dependencies](https://img.shields.io/david/reshape/beautify.svg?style=flat-square)](https://david-dm.org/reshape/beautify)\n[![coverage](https://img.shields.io/coveralls/reshape/beautify.svg?style=flat-square)](https://coveralls.io/r/reshape/beautify?branch=master)\n\nA reshape plugin that pretty-prints your html\n\n\u003e **Note:** This project is in early development, and versioning is a little different. [Read this](http://markup.im/#q4_cRZ1Q) for more details.\n\n### Installation\n\n`npm install reshape-beautify --save`\n\n\u003e **Note:** This project is compatible with node v6+ only\n\n### Usage\n\nAdd it as a reshape plugin:\n\n```js\nconst reshape = require('reshape')\nconst beautify = require('reshape-beautify')\n\nreshape({ plugins: beautify(/* options */) })\n  .process(htmlString)\n  .then((res) =\u003e console.log(res.output()))\n```\n\n...and that's it! You can specify any options as listed below to customize the behavior.\n\nThis plugin will ensure that all tags are correctly indented. However, it will not make changes to any tag that contains a plain text node, because this could interfere with the way the content looks. For example, this crappy html:\n\n```html\n \u003chead\u003e\n    \u003ctitle\u003ebad indentation\u003c/title\u003e\n\u003cmeta name='author' content='not me'\u003e\n      \u003c/head\u003e\n  \u003cbody\u003e\u003csection\u003e    \u003cp\u003ehi there\u003c/p\u003e\n     \u003c/section\u003e\n \u003c/body\u003e\n```\n\nWould be transformed as such:\n\n```html\n\u003chead\u003e\n  \u003ctitle\u003ebad indentation\u003c/title\u003e\n  \u003cmeta name='author' content='not me'\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n  \u003csection\u003e\n    \u003cp\u003ehi there\u003c/p\u003e\n  \u003c/section\u003e\n\u003c/body\u003e\n```\n\nWow, so clean! It will do the same for minified html:\n\n```html\n\u003cbody\u003e\u003cp\u003ehi there\u003c/p\u003e\u003cdiv class='wow'\u003ethis is minified\u003c/div\u003e\u003c/body\u003e\n```\n\nIs transformed to:\n\n```html\n\u003cbody\u003e\n  \u003cp\u003ehi there\u003c/p\u003e\n  \u003cdiv class='wow'\u003ethis is minified\u003c/div\u003e\n\u003c/body\u003e\n```\n\nHowever, if you have something like this:\n\n```html\n\u003csection\u003e\n    hello there!\n \u003cspan\u003ethis is great\u003c/span\u003e\n    \u003c/section\u003e\n```\n\nWe won't alter the spaces inside your section content, because this would change the way it looks on the page, so it would turn out exactly the same as the input.\n\n### Options\n\n| Name | Description | Default |\n| ---- | ----------- | ------- |\n| **indent** | Number of spaces to indent your elements | `2` |\n\n### License \u0026 Contributing\n\n- Details on the license [can be found here](LICENSE.md)\n- Details on running tests and contributing [can be found here](contributing.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freshape%2Fbeautify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freshape%2Fbeautify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freshape%2Fbeautify/lists"}