path-root

WebJar for path-root

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

path-root
Last Version

Last Version

0.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

path-root
WebJar for path-root
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/jonschlinkert/path-root

Download path-root

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/path-root/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>path-root</artifactId>
    <version>0.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/path-root/
implementation 'org.webjars.npm:path-root:0.1.1'
// https://jarcasting.com/artifacts/org.webjars.npm/path-root/
implementation ("org.webjars.npm:path-root:0.1.1")
'org.webjars.npm:path-root:jar:0.1.1'
<dependency org="org.webjars.npm" name="path-root" rev="0.1.1">
  <artifact name="path-root" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='path-root', version='0.1.1')
)
libraryDependencies += "org.webjars.npm" % "path-root" % "0.1.1"
[org.webjars.npm/path-root "0.1.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : path-root-regex jar [0.1.0,0.2)

Project Modules

There are no modules declared in this project.

path-root NPM version NPM downloads Build Status

Get the root of a posix or windows filepath.

You might also be interested in parse-filepath.

Install

Install with npm:

$ npm install path-root --save

Usage

var pathRoot = require('path-root');

Examples

pathRoot('\\\\server\\share\\abc');
//=> '\\\\server\\share\\'

pathRoot('\\\\server foo\\some folder\\base-file.js');
//=> '\\\\server foo\\some folder\\'

pathRoot('\\\\?\\UNC\\server\\share');
//=> '\\\\?\\UNC\\'

pathRoot('foo/bar/baz.js');
//=> ''

pathRoot('c:\\foo\\bar\\baz.js');
//=> 'c:\\'

pathRoot('\\\\slslslsl\\admin$\\system32');
//=> '\\\\slslslsl\\admin$\\'

pathRoot('/foo/bar/baz.js');
//=> '/'

Related projects

You might also be interested in these projects:

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

Generate readme and API documentation with verb:

$ npm install verb && npm run docs

Or, if verb is installed globally:

$ verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb, v, on March 29, 2016.

Versions

Version
0.1.1