Skip to content

Commit b075023

Browse files
committed
update links, add related list
1 parent 8c6c33c commit b075023

File tree

3 files changed

+29
-25
lines changed

3 files changed

+29
-25
lines changed

.verb.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Usage
22

3-
The module exposes a function that must be called to get the regex.
3+
The module exposes a function that must be called to get the regex (modified from the split device regex in the node.js path module);
44

55
```js
66
var pathRootRegex = require('{%= name %}');
@@ -9,10 +9,4 @@ console.log(pathRootRegex() instanceof RegExp);
99
//=> true
1010
```
1111

12-
assert.equal(match('\\\\server\\share\\abc'), '\\\\server\\share\\');
13-
assert.equal(match('\\\\server foo\\some folder\\base-file.js'), '\\\\server foo\\some folder\\');
14-
assert.equal(match('\\\\?\\UNC\\server\\share'), '\\\\?\\UNC\\');
15-
assert.equal(match('foo/bar/baz.js'), '');
16-
assert.equal(match('c:\\foo\\bar\\baz.js'), 'c:\\');
17-
assert.equal(match('\\\\slslslsl\\admin$\\system32'), '\\\\slslslsl\\admin$\\');
18-
assert.equal(match('/foo/bar/baz.js'), '/');
12+
See the [path-root][] module for examples.

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# path-root-regex [![NPM version](https://img.shields.io/npm/v/path-root-regex.svg?style=flat)](https://www.npmjs.com/package/path-root-regex) [![NPM downloads](https://img.shields.io/npm/dm/path-root-regex.svg?style=flat)](https://npmjs.org/package/path-root-regex) [![Build Status](https://img.shields.io/travis/jonschlinkert/path-root-regex.svg?style=flat)](https://travis-ci.org/jonschlinkert/path-root-regex)
1+
# path-root-regex [![NPM version](https://img.shields.io/npm/v/path-root-regex.svg?style=flat)](https://www.npmjs.com/package/path-root-regex) [![NPM downloads](https://img.shields.io/npm/dm/path-root-regex.svg?style=flat)](https://npmjs.org/package/path-root-regex) [![Build Status](https://img.shields.io/travis/regexhq/path-root-regex.svg?style=flat)](https://travis-ci.org/regexhq/path-root-regex)
22

33
> Regular expression for getting the root of a posix or windows filepath.
44
@@ -12,7 +12,7 @@ $ npm install path-root-regex --save
1212

1313
## Usage
1414

15-
The module exposes a function that must be called to get the regex.
15+
The module exposes a function that must be called to get the regex (modified from the split device regex in the node.js path module);
1616

1717
```js
1818
var pathRootRegex = require('path-root-regex');
@@ -21,14 +21,16 @@ console.log(pathRootRegex() instanceof RegExp);
2121
//=> true
2222
```
2323

24-
```assert.equal(match('\\\\server\\share\\abc'), '\\\\server\\share\\');
25-
assert.equal(match('\\\\server foo\\some folder\\base-file.js'), '\\\\server foo\\some folder\\');
26-
assert.equal(match('\\\\?\\UNC\\server\\share'), '\\\\?\\UNC\\');
27-
assert.equal(match('foo/bar/baz.js'), '');
28-
assert.equal(match('c:\\foo\\bar\\baz.js'), 'c:\\');
29-
assert.equal(match('\\\\slslslsl\\admin$\\system32'), '\\\\slslslsl\\admin$\\');
30-
assert.equal(match('/foo/bar/baz.js'), '/');
31-
```
24+
See the [path-root](https://github.com/jonschlinkert/path-root) module for examples.
25+
26+
## Related projects
27+
28+
You might also be interested in these projects:
29+
30+
* [is-absolute](https://www.npmjs.com/package/is-absolute): Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute. | [homepage](https://github.com/jonschlinkert/is-absolute)
31+
* [parse-filepath](https://www.npmjs.com/package/parse-filepath): Parse a filepath into an object. Falls back on the native node.js `path.parse` method if… [more](https://www.npmjs.com/package/parse-filepath) | [homepage](https://github.com/jonschlinkert/parse-filepath)
32+
* [path-root](https://www.npmjs.com/package/path-root): Get the root of a posix or windows filepath. | [homepage](https://github.com/jonschlinkert/path-root)
33+
3234
## Contributing
3335

3436
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/path-root-regex/issues/new).
@@ -65,7 +67,7 @@ $ npm install -d && npm test
6567
## License
6668

6769
Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
68-
Released under the [MIT license](https://github.com/jonschlinkert/path-root-regex/blob/master/LICENSE).
70+
Released under the [MIT license](https://github.com/regexhq/path-root-regex/blob/master/LICENSE).
6971

7072
***
7173

package.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"name": "path-root-regex",
33
"description": "Regular expression for getting the root of a posix or windows filepath.",
44
"version": "0.1.0",
5-
"homepage": "https://github.com/jonschlinkert/path-root-regex",
5+
"homepage": "https://github.com/regexhq/path-root-regex",
66
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
7-
"repository": "jonschlinkert/path-root-regex",
7+
"repository": "regexhq/path-root-regex",
88
"bugs": {
9-
"url": "https://github.com/jonschlinkert/path-root-regex/issues"
9+
"url": "https://github.com/regexhq/path-root-regex/issues"
1010
},
1111
"license": "MIT",
1212
"files": [
@@ -22,7 +22,7 @@
2222
"dependencies": {},
2323
"devDependencies": {
2424
"gulp-format-md": "^0.1.7",
25-
"mocha": "*"
25+
"mocha": "^2.4.5"
2626
},
2727
"keywords": [
2828
"path",
@@ -39,11 +39,19 @@
3939
"plugins": [
4040
"gulp-format-md"
4141
],
42+
"related": {
43+
"list": [
44+
"path-root",
45+
"parse-filepath",
46+
"is-absolute"
47+
]
48+
},
4249
"reflinks": [
43-
"verb"
50+
"verb",
51+
"path-root"
4452
],
4553
"lint": {
4654
"reflinks": true
4755
}
4856
}
49-
}
57+
}

0 commit comments

Comments
 (0)