New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

has-yarn

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

has-yarn - npm Package Compare versions

Comparing version 2.1.0 to 3.0.0

21

index.d.ts

@@ -1,16 +0,7 @@

declare const hasYarn: {
/**
* Check if a project is using [Yarn](https://yarnpkg.com).
*
* @param cwd - Current working directory. Default: `process.cwd()`.
* @returns Whether the project uses Yarn.
*/
(cwd?: string): boolean;
/**
Check if a project is using [Yarn](https://yarnpkg.com).
// TODO: Remove this for the next major release, refactor the whole definition to:
// declare function hasYarn(cwd?: string): boolean;
// export = hasYarn;
default: typeof hasYarn;
};
export = hasYarn;
@param cwd - The current working directory. Default: `process.cwd()`.
@returns Whether the project uses Yarn.
*/
export default function (cwd?: string): boolean;

@@ -1,9 +0,7 @@

'use strict';
const path = require('path');
const fs = require('fs');
import process from 'node:process';
import path from 'node:path';
import fs from 'node:fs';
const hasYarn = (cwd = process.cwd()) => fs.existsSync(path.resolve(cwd, 'yarn.lock'));
module.exports = hasYarn;
// TODO: Remove this for the next major release
module.exports.default = hasYarn;
export default function hasYarn(cwd = process.cwd()) {
return fs.existsSync(path.resolve(cwd, 'yarn.lock'));
}
{
"name": "has-yarn",
"version": "2.1.0",
"version": "3.0.0",
"description": "Check if a project is using Yarn",
"license": "MIT",
"repository": "sindresorhus/has-yarn",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=8"
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},

@@ -35,6 +38,6 @@ "scripts": {

"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.1",
"xo": "^0.24.0"
"ava": "^3.15.0",
"tsd": "^0.17.0",
"xo": "^0.44.0"
}
}

@@ -1,2 +0,2 @@

# has-yarn [![Build Status](https://travis-ci.org/sindresorhus/has-yarn.svg?branch=master)](https://travis-ci.org/sindresorhus/has-yarn)
# has-yarn

@@ -9,3 +9,2 @@ > Check if a project is using [Yarn](https://yarnpkg.com)

## Install

@@ -17,3 +16,2 @@

## Usage

@@ -31,3 +29,3 @@

```js
const hasYarn = require('has-yarn');
import hasYarn from 'has-yarn';

@@ -41,6 +39,5 @@ hasYarn('foo');

## API
### hasYarn([cwd])
### hasYarn(cwd?)

@@ -51,15 +48,9 @@ Returns a `boolean` of whether the project uses Yarn.

Type: `string`<br>
Type: `string`\
Default: `process.cwd()`
Current working directory.
The current working directory.
## Related
- [has-yarn-cli](https://github.com/sindresorhus/has-yarn-cli) - CLI for this module
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc