Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbenner-radham/node-yarn-lockfile-exists
Check for a Yarn lockfile in the current working directory.
https://github.com/jbenner-radham/node-yarn-lockfile-exists
exists file lock lockfile yarn
Last synced: about 2 months ago
JSON representation
Check for a Yarn lockfile in the current working directory.
- Host: GitHub
- URL: https://github.com/jbenner-radham/node-yarn-lockfile-exists
- Owner: jbenner-radham
- License: mit
- Created: 2017-12-17T01:50:34.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2022-12-25T14:58:50.000Z (about 2 years ago)
- Last Synced: 2024-10-09T17:07:37.569Z (3 months ago)
- Topics: exists, file, lock, lockfile, yarn
- Language: JavaScript
- Size: 141 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
yarn-lockfile-exists
====================
[![CI Status](https://img.shields.io/github/actions/workflow/status/jbenner-radham/node-yarn-lockfile-exists/ci.yaml?branch=main)](https://github.com/jbenner-radham/node-yarn-lockfile-exists/actions/workflows/ci.yaml)
[![npm](https://img.shields.io/npm/v/yarn-lockfile-exists.svg)](https://www.npmjs.com/package/yarn-lockfile-exists)
[![Node.js](https://img.shields.io/node/v/yarn-lockfile-exists.svg)](https://nodejs.org/)
[![License](https://img.shields.io/github/license/jbenner-radham/node-yarn-lockfile-exists.svg)](LICENSE)Check for a Yarn lockfile in the current working directory.
Install
-------
```sh
yarn add yarn-lockfile-exists # Or alternatively: `npm install yarn-lockfile-exists`
```Usage
-----
### JavaScript
```js
import yarnLockfileExists from 'yarn-lockfile-exists';// Returns `true` or `false` based off of if there is a `yarn.lock` file in the location
// that `process.cwd()` points to.
yarnLockfileExists();// Optionally you can specify the current working directory for the function to operate in.
const cwd = '/home/myself/awesome-project';yarnLockfileExists({ cwd });
```### TypeScript
```ts
import yarnLockfileExists, { type YarnLockfileExistsConfig } from 'yarn-lockfile-exists';// Returns `true` or `false` based off of if there is a `yarn.lock` file in the location
// that `process.cwd()` points to.
yarnLockfileExists();// Optionally you can specify the current working directory for the function to operate in.
const config: YarnLockfileExistsConfig = {
cwd: '/home/myself/awesome-project'
};yarnLockfileExists(config);
```**NOTE**: This is a pure ESM package. See [here](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) for details.
Testing
-------
```sh
yarn test # Or alternatively: `npm test`
```License
-------
The MIT License. See the [license file](LICENSE) for details.