canonical-path

WebJar for canonical-path

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

canonical-path
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

canonical-path
WebJar for canonical-path
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/petebacondarwin/node-canonical-path

Download canonical-path

How to add to project

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

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Canonical Path Utility

When writing node.js code that must support Windows and *nix OSes, it is sometimes frustrating that path segments are separated differently depending upon the environment.

Ironically, we can pass in paths with either separator and the library will normalize it to the current OS's format. But it then returns paths using the current OS's separator.

This utility simple wraps the built-in path library such that it only ever returns path segments separated by forward slashes (/).

Installation

npm install --save canonical-path

Usage

var path = require('canonical-path');

var p = path.normalize('a/b/../c');
// p === 'a/c';

Testing

npm test

Versions

Version
1.0.0