{"name":"@changesets/format","version":"0.0.0","author":{"name":"Changesets"},"license":"MIT","_id":"@changesets/format@0.0.0","maintainers":[{"name":"noviny","email":"benjaminconolly@gmail.com"},{"name":"changesets-release-bot","email":"automation+changesets@thinkmill.com.au"},{"name":"emmatown","email":"npm@emmas.town"},{"name":"andarist","email":"mateuszburzynski@gmail.com"}],"dist":{"shasum":"80d3f1658b30abe9b2175cd0e53ed285fcc76e00","tarball":"http://registry-npm.ywwl.com/@changesets/format/download/@changesets/format-0.0.0.tgz","fileCount":1,"integrity":"sha512-3Mzt1bly2kDLyqRZeU9xcEc4O7jTtZ8x10QN2gz7K6WzI8LdnQqIbRlqfpL08ggxgxGLW8ekw95EftMPoY3RwA==","signatures":[{"sig":"MEUCIGPh3gLOGsnYmze10r7WKZsAZJHElJLpg0NgG+BkHHDbAiEAqNtl1VEH05sinHA9kmTO2zte44h6vqAE3/MbDdzsDw0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":147,"size":202,"noattachment":false,"key":"/@changesets/format/-/@changesets/format-0.0.0.tgz"},"gitHead":"ffedb263443a95050eab4ae7684c36de087bab0d","_npmUser":{"name":"andarist","email":"mateuszburzynski@gmail.com"},"_npmVersion":"11.13.0","description":"Detect and format files","directories":{},"_nodeVersion":"24.3.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/format_0.0.0_1778570315069_0.9144549820359966","host":"s3://npm-registry-packages-npm-production"},"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":1778570315203,"_cnpm_publish_time":1778570315203,"dist-tags":{"latest":"0.1.3"}}