{"id":15416583,"url":"https://github.com/remcohaszing/unified-prettier","last_synced_at":"2025-10-10T00:07:24.701Z","repository":{"id":181407368,"uuid":"666733328","full_name":"remcohaszing/unified-prettier","owner":"remcohaszing","description":"A unified plugin to format output using Prettier","archived":false,"fork":false,"pushed_at":"2025-04-14T08:15:54.000Z","size":579,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T09:27:47.397Z","etag":null,"topics":["prettier","rehype","rehype-plugin","remark","remark-plugin","unified","unified-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/remcohaszing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-07-15T11:51:59.000Z","updated_at":"2025-04-14T08:15:57.000Z","dependencies_parsed_at":"2024-06-21T03:26:15.747Z","dependency_job_id":"210a577b-f222-4231-87d0-c57726dff974","html_url":"https://github.com/remcohaszing/unified-prettier","commit_stats":null,"previous_names":["remcohaszing/unified-prettier"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Funified-prettier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Funified-prettier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Funified-prettier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Funified-prettier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remcohaszing","download_url":"https://codeload.github.com/remcohaszing/unified-prettier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248855017,"owners_count":21172471,"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":["prettier","rehype","rehype-plugin","remark","remark-plugin","unified","unified-plugin"],"created_at":"2024-10-01T17:12:31.592Z","updated_at":"2025-10-10T00:07:19.682Z","avatar_url":"https://github.com/remcohaszing.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unified-prettier\n\n[![github actions](https://github.com/remcohaszing/unified-prettier/actions/workflows/ci.yaml/badge.svg)](https://github.com/remcohaszing/unified-prettier/actions/workflows/ci.yaml)\n[![npm version](https://img.shields.io/npm/v/unified-prettier)](https://www.npmjs.com/package/unified-prettier)\n[![npm downloads](https://img.shields.io/npm/dm/unified-prettier)](https://www.npmjs.com/package/unified-prettier)\n[![codecov](https://codecov.io/gh/remcohaszing/unified-prettier/branch/main/graph/badge.svg)](https://codecov.io/gh/remcohaszing/unified-prettier)\n\nA [unified](https://unifiedjs.com) plugin to format output using [Prettier](https://prettier.io/).\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API](#api)\n  - [Options](#options)\n- [Related projects](#related-projects)\n- [Compatibility](#compatibility)\n- [Acknowledgements](#acknowledgements)\n- [License](#license)\n\n## Installation\n\n```sh\nnpm install unified-prettier\n```\n\n## Usage\n\nThis unified plugin takes content from another compiler, and reformats the output using Prettier.\nIt’s intended to work with\n[`unified-engine`](https://github.com/unifiedjs/unified-engine/blob/main/readme.md) implementations,\nsuch as [`remark-cli`](https://github.com/remarkjs/remark/tree/main/packages/remark-cli) and\n[`rehype-cli`](https://github.com/rehypejs/rehype/tree/main/packages/rehype-cli).\n\nIn your\n[configuration file](https://github.com/unifiedjs/unified-engine/blob/main/doc/configure.md), add\n`unified-prettier` to the plugins:\n\n```json\n{\n  \"plugins\": [\"unified-prettier\"]\n}\n```\n\nIt can also be used programmatically. Although you’re probably better off passing the output value\nto Prettier directly.\n\nThe following example formats the readme using Prettier.\n\n```js\nimport { remark } from 'remark'\nimport { read } from 'to-vfile'\nimport unifiedPrettier from 'unified-prettier'\n\nconst processor = remark.use(unifiedPrettier)\nconst file = await read('README.md')\n\nconst { value } = await processor.process(file)\n\nconsole.log(value)\n```\n\nThe following package formats the readme using Prettier after updating the table of contents.\n\n```js\nimport { remark } from 'remark'\nimport remarkToc from 'remark-toc'\nimport { read } from 'to-vfile'\nimport unifiedPrettier from 'unified-prettier'\n\nconst processor = remark.use(remarkToc).use(unifiedPrettier)\nconst file = await read('README.md')\n\nconst { value } = await processor.process(file)\n\nconsole.log(value)\n```\n\n## API\n\nThe default export is a [unified](https://unifiedjs.com) plugin.\n\n### Options\n\nThis plugin accepts Prettier [options](https://prettier.io/docs/en/options.html). By default it uses\nthe options from the Prettier [configuration file](https://prettier.io/docs/en/configuration.html).\n\n## Related projects\n\n- [`prettier`](https://prettier.io) is an opiniated code formatter.\n- [`unified`](https://unifiedjs.com) is a tool that transforms content with plugins.\n- [`unified-consistency`](https://github.com/remcohaszing/unified-consistency) can be used to report\n  output inconsistencies.\n\n## Compatibility\n\nThis project is compatible with Node.js 16 or greater, Prettier 3, and unified 11.\n\n## Acknowledgements\n\nThanks to [@JounQin](https://github.com/JounQin) for giving me the npm package name.\n\n## License\n\n[MIT](LICENSE.md) © [Remco Haszing](https://github.com/remcohaszing)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremcohaszing%2Funified-prettier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremcohaszing%2Funified-prettier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremcohaszing%2Funified-prettier/lists"}