{"name":"has-yarn","version":"4.0.0","description":"Check if a project is using Yarn","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/has-yarn.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava"},"keywords":["yarn","has","detect","is","project","app","module","package","manager","npm"],"dependencies":{"find-up-simple":"^1.0.1"},"devDependencies":{"ava":"^6.4.1","xo":"^1.2.2"},"_id":"has-yarn@4.0.0","gitHead":"af21f7c9b8a31bc3367af420a1fbeca31739509c","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/has-yarn/issues"},"homepage":"https://github.com/sindresorhus/has-yarn#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-A+TLqmkJN+H2tiyhEFzA4VR/Mr/qhPBcEqYiNyiduamvp6mQ1dsjF/LTxli+3XwbV8DrZLwj/bYXkVhHOrW9EQ==","shasum":"344c25e8f9fa76ec801aec273c2ff97817bba6e7","tarball":"http://registry-npm.ywwl.com/has-yarn/download/has-yarn-4.0.0.tgz","fileCount":5,"unpackedSize":3446,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQChljjHlhmDPFdWmZ/uqjHunLnghXIgHT1eDWwsBNRsMgIhAIugGuEnG0C2Dj0HKUqp3QQRoTEqdchmG8iPd5brZJh5"}],"size":1880,"noattachment":false,"key":"/has-yarn/-/has-yarn-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/has-yarn_4.0.0_1757887210330_0.7122454551242059"},"_hasShrinkwrap":false,"readme":"# has-yarn\n\n> Check if a project is using [Yarn](https://yarnpkg.com)\n\nUseful for tools that needs to know whether to use `yarn` or `npm` to install dependencies.\n\nIt checks for a `yarn.lock` file in the given directory or any of its parent directories (useful for Yarn workspaces).\n\n## Install\n\n```sh\nnpm install has-yarn\n```\n\n## Usage\n\n```\n.\n├── foo\n│   └── package.json\n└── bar\n    ├── package.json\n    └── yarn.lock\n```\n\n```js\nimport hasYarn from 'has-yarn';\n\nhasYarn('foo');\n//=> false\n\nhasYarn('bar');\n//=> true\n\n// In a Yarn workspace\nhasYarn('bar/packages/some-package');\n//=> true\n```\n\n## API\n\n### hasYarn(cwd?)\n\nReturns a `boolean` of whether the project uses Yarn.\n\n#### cwd\n\nType: `string`\\\nDefault: `process.cwd()`\n\nThe directory to check. The search also walks up parent directories until the filesystem root.\n\n## Related\n\n- [has-yarn-cli](https://github.com/sindresorhus/has-yarn-cli) - CLI for this package\n","publish_time":1757887210522,"_cnpm_publish_time":1757887210522,"dist-tags":{"latest":"4.0.0"}}