# regex-dirname-windows

> Regular expression to capture a Windows path dirname.

Latest version **1.0.0** (published 2015-10-03) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-10-03 |
| First published | 2015-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Athan Reines |
| Maintainers | kgryte |
| Keywords | regex, regexp, regular, expression, string, path, pathname, capture, match, dir, dirname, file, filename, windows |

## Links

- npm: https://www.npmjs.com/package/regex-dirname-windows
- Repository: https://github.com/kgryte/regex-dirname-windows
- Homepage: https://github.com/kgryte/regex-dirname-windows#readme
- Issues: https://github.com/kgryte/regex-dirname-windows/issues
- npm.io page: https://npm.io/package/regex-dirname-windows

## 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-10-03
- 0.0.0 — 2015-10-03

## README

dirname
===
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependencies][dependencies-image]][dependencies-url]

> [Regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) to capture a Windows path [dirname](https://en.wikipedia.org/wiki/Dirname).


## Installation

``` bash
$ npm install regex-dirname-windows
```


## Usage

``` javascript
var re = require( 'regex-dirname-windows' );
```

#### re

[Regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) to capture a Windows path [dirname](https://en.wikipedia.org/wiki/Dirname). 

``` javascript
var base = re.exec( 'foo\\bar\\index.js' )[ 1 ];
// returns 'foo\\bar'
```


## Examples

``` javascript
var re = require( 'regex-dirname-windows' );

var dir;

dir = re.exec( 'index.js' )[ 1 ];
console.log( dir );
// returns ''

dir = re.exec( 'C:\\foo\\bar\\home.html' )[ 1 ];
console.log( dir );
// returns 'C:\\foo\\bar'

dir = re.exec( 'foo\\file.pdf' )[ 1 ];
console.log( dir );
// returns 'foo'

dir = re.exec( 'beep\\boop.' )[ 1 ];
console.log( dir );
// returns 'beep'

dir = re.exec( '' )[ 1 ];
console.log( dir );
// returns ''

dir = re.exec( '\\foo\\bar\\file' )[ 1 ];
console.log( dir );
// returns '\\foo\\bar'

dir = re.exec( 'C:\\foo\\bar\\.gitignore' )[ 1 ];
console.log( dir );
// returns 'C:\\foo\\bar'
```

To run the example code from the top-level application directory,

``` bash
$ node ./examples/index.js
```


## Tests

### Unit

Unit tests use the [Mocha](http://mochajs.org/) test framework with [Chai](http://chaijs.com) assertions. To run the tests, execute the following command in the top-level application directory:

``` bash
$ make test
```

All new feature development should have corresponding unit tests to validate correct functionality.


### Test Coverage

This repository uses [Istanbul](https://github.com/gotwarlost/istanbul) as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:

``` bash
$ make test-cov
```

Istanbul creates a `./reports/coverage` directory. To access an HTML version of the report,

``` bash
$ make view-cov
```


---
## License

[MIT license](http://opensource.org/licenses/MIT).


## Copyright

Copyright &copy; 2015. Athan Reines.


[npm-image]: http://img.shields.io/npm/v/regex-dirname-windows.svg
[npm-url]: https://npmjs.org/package/regex-dirname-windows

[travis-image]: http://img.shields.io/travis/kgryte/regex-dirname-windows/master.svg
[travis-url]: https://travis-ci.org/kgryte/regex-dirname-windows

[codecov-image]: https://img.shields.io/codecov/c/github/kgryte/regex-dirname-windows/master.svg
[codecov-url]: https://codecov.io/github/kgryte/regex-dirname-windows?branch=master

[dependencies-image]: http://img.shields.io/david/kgryte/regex-dirname-windows.svg
[dependencies-url]: https://david-dm.org/kgryte/regex-dirname-windows

[dev-dependencies-image]: http://img.shields.io/david/dev/kgryte/regex-dirname-windows.svg
[dev-dependencies-url]: https://david-dm.org/dev/kgryte/regex-dirname-windows

[github-issues-image]: http://img.shields.io/github/issues/kgryte/regex-dirname-windows.svg
[github-issues-url]: https://github.com/kgryte/regex-dirname-windows/issues

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