# @appgeist/ensure-dir

> Utility function to ensure a directory path exists and return a Promise

Latest version **1.1.4** (published 2020-04-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install @appgeist/ensure-dir
pnpm add @appgeist/ensure-dir
yarn add @appgeist/ensure-dir
bun add @appgeist/ensure-dir
```

## Health

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

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2020-04-25 |
| First published | 2019-07-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | separate (@types/appgeist__ensure-dir) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Ionut-Cristian Florescu |
| Maintainers | icflorescu |
| Keywords | utilities, shell, directory, check, create, mkdirp, promise |

## Links

- npm: https://www.npmjs.com/package/@appgeist/ensure-dir
- Repository: https://github.com/appgeist/ensure-dir
- Issues: https://github.com/appgeist/ensure-dir/issues
- npm.io page: https://npm.io/package/@appgeist/ensure-dir

## Dependencies (1)

- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.5

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads

## Recent versions

- 1.1.4 (latest) — 2020-04-25
- 1.1.3 — 2019-10-11
- 1.1.2 — 2019-09-30
- 1.1.1 — 2019-09-29
- 1.1.0 — 2019-08-29
- 1.0.7 — 2019-08-12
- 1.0.6 — 2019-07-23
- 1.0.5 — 2019-07-18
- 1.0.4 — 2019-07-13
- 1.0.3 — 2019-07-13
- 1.0.2 — 2019-07-10
- 1.0.1 — 2019-07-09
- 1.0.0 — 2019-07-09

## README

# @appgeist/ensure-dir

[![NPM version][npm-image]][npm-url]
[![License][license-image]][license-url]

Utility function to ensure a directory path exists and return a Promise.
Uses [mkdirp](https://www.npmjs.com/package/mkdirp) under the hood.

## Usage

```js
const ensureDir = require("@appgeist/ensure-dir");

await ensureDir("/folder/to/store/lotsa/files");
```

### Why not [mkdirp-promise](https://www.npmjs.com/package/mkdirp-promise)?

@appgeist/ensure-dir should be slightly more efficient than [mkdirp-promise](https://www.npmjs.com/package/mkdirp-promise) because it checks whether the specified path exists before trying to create it.

## License

The [ISC License](LICENSE).

[npm-image]: https://img.shields.io/npm/v/@appgeist/ensure-dir.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/@appgeist/ensure-dir
[license-image]: https://img.shields.io/npm/l/@appgeist/ensure-dir.svg?style=flat-square
[license-url]: LICENSE

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