{"name":"@changesets/format","version":"0.1.2","description":"Detect and format files","bugs":{"url":"https://github.com/changesets/format/issues"},"license":"MIT","author":"Changesets","repository":{"type":"git","url":"git+https://github.com/changesets/format.git"},"type":"module","exports":"./dist/index.js","dependencies":{"package-manager-detector":"^1.8.0","tinyexec":"^1.3.0"},"devDependencies":{"@changesets/changelog-github":"^1.0.0","@changesets/cli":"^3.0.0","@types/node":"^26.1.2","fs-fixture":"^2.14.0","oxfmt":"^0.62.0","tsdown":"^0.22.14","typescript":"~7.0.2","vitest":"^4.1.10"},"engines":{"node":"^22.11 || ^24 || >=26"},"scripts":{"dev":"tsdown --watch","build":"tsdown","test":"vitest","format":"oxfmt","lint":"oxfmt --check","typecheck":"tsc"},"_nodeVersion":"24.18.0","_id":"@changesets/format@0.1.2","dist":{"integrity":"sha512-Caez5XtNXCFS/G5bwyav3wuXL0tMxVd2ZGbaumWbzN08tyzO21asCw7JZhNtVsAZDCvDRUzZN+Iit9SyRITSYA==","shasum":"036f5e32ebbcd0b5220f7f5092e617e10d9f96dc","tarball":"http://registry-npm.ywwl.com/@changesets/format/download/@changesets/format-0.1.2.tgz","fileCount":5,"unpackedSize":11480,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@changesets%2fformat@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGJm1t62220WdmoP4xUPxEEIZlS21yd1SErADcfSzz9fAiAXPPL9cZh321T/ko5wr89CCkM7R5Ko4HYu9c7ARRQ5+g=="}],"size":3796,"noattachment":false,"key":"/@changesets/format/-/@changesets/format-0.1.2.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d4d7ed59-5545-4f9d-88b1-ef5816e4185d"}},"directories":{},"maintainers":[{"name":"emmatown","email":"npm@emmas.town"},{"name":"andarist","email":"mateuszburzynski@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/format_0.1.2_1786642192357_0.8810776670888736"},"_hasShrinkwrap":false,"readme":"# @changesets/format\n\nDetect installed code formatters and format files with them.\n\n## Usage\n\n### `detect()`\n\n<!-- NOTE: Docs should match src/detect.ts -->\n\nDetect the preferred formatter used in the project.\n\n```ts\nimport { detect } from \"@changesets/format\";\n\nconst result = await detect();\n// => \"prettier\"\n```\n\nOptions can be passed to the first parameter:\n\n- `cwd`: The current working directory to start looking up for the formatter. Defaults to `process.cwd()`.\n- `stopDir`: The path to stop traversing up the directory.\n- `order`: The order of formatters to check for. Defaults to `[\"dprint\", \"deno\", \"oxfmt\", \"biome\", \"prettier\"]` (from `defaultDetectOrder`)\n\n### `format()`\n\nFormat the given patterns with a specified or auto-detected formatter. It returns `true` if a formatter is found and the formatting process passes (even if the patterns didn't match any files), otherwise returns `false`.\n\n<!-- NOTE: Docs should match src/format.ts -->\n\n```ts\nimport { format } from \"@changesets/format\";\n\nawait format([\"src/index.ts\"]);\n```\n\nOptions can be passed to the second parameter:\n\n- `formatter`: The formatter to use for formatting. It not specified, it will be auto-detected using `detect`. Use `detect` directly if you want to have more control over the detection process.\n- `cwd`: The current working directory to start looking up for the formatter and package manager, and to execute the formatter's command from. Defaults to `process.cwd()`.\n- `stopDir`: The path to stop traversing up the directory.\n- `packageManager`: The package manager to use for executing the formatter's command. If not specified, it will use `package-manager-detector` to detect the package manager.\n\n## Thanks\n\nThe core idea of this package is based on [formatly](https://github.com/JoshuaKGoldberg/formatly), but implemented for Changesets' needs. However, it is still generic enough to be used by other projects than Changesets.\n\n## License\n\nMIT\n","publish_time":1786642192508,"_cnpm_publish_time":1786642192508,"dist-tags":{"latest":"0.1.3"}}