npm.io
0.1.6 • Published 10 years ago

is-local-path

Licence
MIT
Version
0.1.6
Deps
0
Vulns
0
Weekly
0

is-local-path

Test whether a path is local.

npm version npm license Travis David npm downloads

Installation

npm install is-local-path

Usage

var isLocalPath = require('is-local-path');

isLocalPath('/path/to/file.ext')); // true
isLocalPath('/path/to/directory')); // true
isLocalPath('./relative/path')); // true
isLocalPath('../relative/path')); // true

isLocalPath('http://host.com/path/to/file.ext')); // false
isLocalPath('data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D')); // false

API


isLocalPath ( string )

Tests whether a string is a local path.

Arguments

  • string - A string to test.