{"_id":"@changesets/format@0.1.3","bugs":{"url":"https://github.com/changesets/format/issues"},"dist":{"shasum":"dc1eb309a1cdbe3137fcd3521ed3311ea742e8eb","tarball":"http://registry-npm.ywwl.com/@changesets/format/download/@changesets/format-0.1.3.tgz","fileCount":5,"integrity":"sha512-zTZrJbfY81+/MsXsey6i3jQjpApz4PqRQ+nouHGDJhCa5sKCExwR9mZFQ/67lMsqZDNy2G2v3wTbzOmZ56EtaQ==","signatures":[{"sig":"MEUCIQD/3V5ZURhjuXpngjGPF1ZKH1PvAY6FjYYUYJjW1Aj8TAIgILyhQWXwqCWTo/uYrdw9csxXjy1dsh1UEbwRyLpBNFw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGGCM2cj/uWgu3o4L5CzrHNL1FRqkdN6JPXeGQunlxbGAiBXleIMTjdoTQ0yWJXI4S9qro5Y1PPlQgC0j1XJVORd6Q=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@changesets%2fformat@0.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":11403,"size":3791,"noattachment":false,"key":"/@changesets/format/-/@changesets/format-0.1.3.tgz"},"name":"@changesets/format","type":"module","author":"Changesets","engines":{"node":"^22.11 || ^24 || >=26"},"exports":"./dist/index.js","license":"MIT","scripts":{"dev":"tsdown --watch","lint":"oxfmt --check","test":"vitest","build":"tsdown","format":"oxfmt","typecheck":"tsc"},"version":"0.1.3","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"d4d7ed59-5545-4f9d-88b1-ef5816e4185d"}},"repository":{"url":"git+https://github.com/changesets/format.git","type":"git"},"description":"Detect and format files","directories":{},"maintainers":[{"name":"emmatown","email":"npm@emmas.town"},{"name":"andarist","email":"mateuszburzynski@gmail.com"}],"_nodeVersion":"24.21.0","dependencies":{"tinyexec":"^1.3.1","package-manager-detector":"^1.8.0"},"_hasShrinkwrap":false,"devDependencies":{"oxfmt":"^0.70.0","tsdown":"^0.23.0","vitest":"^5.0.1","fs-fixture":"^2.16.0","typescript":"~7.0.2","@types/node":"^26.6.2","@changesets/cli":"^3.0.3","@changesets/changelog-github":"^1.0.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/format_0.1.3_1792740902477_0.9411567957748526"},"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":1792740902572,"_cnpm_publish_time":1792740902572,"dist-tags":{"latest":"0.1.3"}}