Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/panosoft/is-local-path
Test whether a path is local.
https://github.com/panosoft/is-local-path
Last synced: about 2 months ago
JSON representation
Test whether a path is local.
- Host: GitHub
- URL: https://github.com/panosoft/is-local-path
- Owner: panosoft
- Created: 2015-07-22T22:59:08.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-17T22:51:19.000Z (about 9 years ago)
- Last Synced: 2024-10-29T00:54:23.098Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# is-local-path
Test whether a path is local.
[![npm version](https://img.shields.io/npm/v/is-local-path.svg)](https://www.npmjs.com/package/is-local-path)
[![npm license](https://img.shields.io/npm/l/is-local-path.svg)](https://www.npmjs.com/package/is-local-path)
[![Travis](https://img.shields.io/travis/panosoft/is-local-path.svg)](https://travis-ci.org/panosoft/is-local-path)
[![David](https://img.shields.io/david/panosoft/is-local-path.svg)](https://david-dm.org/panosoft/is-local-path)
[![npm downloads](https://img.shields.io/npm/dm/is-local-path.svg)](https://www.npmjs.com/package/is-local-path)## Installation
```sh
npm install is-local-path
```## Usage
```js
var isLocalPath = require('is-local-path');isLocalPath('/path/to/file.ext')); // true
isLocalPath('/path/to/directory')); // true
isLocalPath('./relative/path')); // true
isLocalPath('../relative/path')); // trueisLocalPath('http://host.com/path/to/file.ext')); // false
isLocalPath('data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D')); // false
```## API
- [`isLocalPath`](#isLocalPath)
---
Tests whether a `string` is a local path.
__Arguments__
- `string` - A string to test.