/is-same-path

🚷 Check that two directories resolve to the same path.

Primary LanguageJavaScript

is-same-path Build Status

🚷 Check that two directories resolve to the same path.

is-same-path is a simple function to check if two paths resolve to the same path.

Installation

Simply type:

npm install --save is-same-path

Getting Started

const isSamePath = require('is-same-path');

const paths = ['./.././//file', '../file'];

console.log(isSamePath(...paths)); // "true"

JavaScript API

isSamePath(path1, path2)

Check if two paths with different notation are the same when resolved.

  • path1: A file system path as a String.
  • path2: A second file system path as a String.
  • Return: true if both path resolve to the same path.

License

This module and the whole directory is subject to the MIT license.

I usually prefer the GPL license, but I don’t think it’s big enough care for that (and scare people like you).

Copyright (c) 2017 Etienne Prud’homme