# lerna-current-dir-updated

> Check whether the current working directory is part of a lerna package that has been updated.

Latest version **0.2.0** (published 2018-08-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install lerna-current-dir-updated
pnpm add lerna-current-dir-updated
yarn add lerna-current-dir-updated
bun add lerna-current-dir-updated
```

Provides the commands `lerna-current-dir-updated`, `lerna-current-dir-not-updated`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2018-08-15 |
| First published | 2018-02-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 1 |
| Unpacked size | 129.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Jacob LeGrone |
| Maintainers | jlegrone |

## Links

- npm: https://www.npmjs.com/package/lerna-current-dir-updated
- Repository: https://github.com/jlegrone/lerna-current-dir-updated
- Homepage: https://github.com/jlegrone/lerna-current-dir-updated#readme
- Issues: https://github.com/jlegrone/lerna-current-dir-updated/issues
- npm.io page: https://npm.io/package/lerna-current-dir-updated

## Dependencies (1)

- [read-pkg-up](https://npm.io/package/read-pkg-up.md) ^3.0.0

## Recent versions

- 0.2.0 (latest) — 2018-08-15
- 0.1.0 — 2018-02-19
- 0.0.0 — 2018-02-17

## README

# lerna-current-dir-updated

[![npm version](https://badge.fury.io/js/lerna-current-dir-updated.svg)](https://badge.fury.io/js/lerna-current-dir-updated)

`lerna-current-dir-updated` provides a simple way to check whether the current working directory is part of a [lerna](https://lernajs.io) package that has been updated.

This can be especially useful when you wish to naively determine whether to run tests from a given directory in CI environments.

## Installation

```bash
$ npm install --global lerna-current-dir-updated
```

**Note**: [lerna](https://lernajs.io) must already be in your path (installed globally) in order for this package to work.

## Usage

`lerna-current-dir-updated` and `lerna-current-dir-not-updated` accept the same flags as the [lerna list](https://github.com/lerna/lerna/tree/master/commands/list) command.

### `lerna-current-dir-updated`

Exits non-zero if the current directory *has not* been updated.

```bash
$ cd packages/my-package-name
$ lerna-current-dir-updated --since develop && npm test
my-package-name is not updated.
```

### `lerna-current-dir-not-updated`

Exits non-zero if the current directory *has* been updated.

This command can be chained with another using an OR operator in order to avoid exiting non-zero in CI environments. In the below example tests are only run if the package has been updated, and nothing will show as a failure in CI unless `npm test` fails to pass.

```bash
$ cd packages/my-package-name
$ lerna-current-dir-not-updated --since master || npm test
my-package-name is updated.
... # npm test output
```

---
_Source: https://npm.io/package/lerna-current-dir-updated · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
