{"name":"@changesets/format","version":"0.1.0","author":"Changesets","license":"MIT","_id":"@changesets/format@0.1.0","maintainers":[{"name":"emmatown","email":"npm@emmas.town"},{"name":"andarist","email":"mateuszburzynski@gmail.com"}],"bugs":{"url":"https://github.com/changesets/format/issues"},"dist":{"shasum":"b753ba9b9283c449bb590ab14879fcfe850999b5","tarball":"http://registry-npm.ywwl.com/@changesets/format/download/@changesets/format-0.1.0.tgz","fileCount":5,"integrity":"sha512-m3ScsTpVqQJu6WOV36vpGozJPBu5JWaFXAhG1/yRnzbOnyqomuPrIfm+LeE0PmX4HWPs9Fh4MDH4aDISEsjZaA==","signatures":[{"sig":"MEUCIQCRoeeXAUSuC7DOQRU0Ld22brAGOJMZwbjAKZu+L/WHrAIgXh55fxO3wdZZoqFY4wXuiOvHHctM0MU/hcVasv9gQxQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@changesets%2fformat@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":11271,"size":3772,"noattachment":false,"key":"/@changesets/format/-/@changesets/format-0.1.0.tgz"},"type":"module","engines":{"node":"^22.11 || ^24 || >=26"},"exports":"./dist/index.js","scripts":{"dev":"tsdown --watch","lint":"oxfmt --check","test":"vitest","build":"tsdown","format":"oxfmt","release":"changeset publish","typecheck":"tsc"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d4d7ed59-5545-4f9d-88b1-ef5816e4185d"}},"repository":{"url":"git+https://github.com/changesets/format.git","type":"git"},"description":"Detect and format files","directories":{},"_nodeVersion":"26.0.0","dependencies":{"package-manager-detector":"^1.6.0"},"_hasShrinkwrap":false,"devDependencies":{"oxfmt":"^0.48.0","tsdown":"^0.22.0","vitest":"^4.1.5","fs-fixture":"^2.13.0","typescript":"~6.0.3","@types/node":"^25.6.2","@changesets/cli":"^3.0.0-next.3","@changesets/changelog-github":"^1.0.0-next.3"},"_npmOperationalInternal":{"tmp":"tmp/format_0.1.0_1778599185728_0.7013943010992179","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":1778599186005,"_cnpm_publish_time":1778599186005,"dist-tags":{"latest":"0.1.3"}}