# dirname-regex

> Regular expression for matching the directory part of a file path.

Latest version **1.0.0** (published 2015-01-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install dirname-regex
pnpm add dirname-regex
yarn add dirname-regex
bun add dirname-regex
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-01-13 |
| First published | 2014-12-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/dirname-regex) |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Jon Schlinkert |
| Maintainers | jonschlinkert |
| Keywords | dir, directory, dirname, expression, filepath, match, path, regex, regexp, regular |

## Links

- npm: https://www.npmjs.com/package/dirname-regex
- Repository: https://github.com/regexps/dirname-regex
- Issues: https://github.com/regexps/dirname-regex/issues
- npm.io page: https://npm.io/package/dirname-regex

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-01-13
- 0.1.0 — 2014-12-28

## README

# dirname-regex [![NPM version](https://badge.fury.io/js/dirname-regex.svg)](http://badge.fury.io/js/dirname-regex)

> Regular expression for matching the directory part of a file path.

## Install with [npm](npmjs.org)

```bash
npm i dirname-regex --save
```

## Usage

```js
var dirnameRe = require('dirname-regex');
var match = 'a/b/c/d.md'.match(dirnameRe());

match[0];
//=> 'a/b/c/d.md'

match[1];
//=> 'a/b/c/'

match[2];
//=> 'a/b/c'
```

See the [tests](./test.js) for more use cases and expected results.

## Run tests

Install dev dependencies:

```bash
node i -d && mocha
```

## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/regexps/dirname-regex/issues)

## Author

**Jon Schlinkert**
 
+ [github/regexps](https://github.com/regexps)
+ [twitter/regexps](http://twitter.com/regexps) 

## License
Copyright (c) 2014-2015 Jon Schlinkert  
Released under the MIT license

***

_This file was generated by [verb](https://github.com/assemble/verb) on January 12, 2015._

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