Skip to content

A regular expression to match a remote URL for defined HTML document text.

License

Notifications You must be signed in to change notification settings

vamtiger-project/vamtiger-is-remote-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VAMTIGER Is Remote URL

VAMTIGER Is Remote URL will return a boolean when evaluating a defined url string.

Installation

VAMTIGER Is Remote URL can be installed using npm or yarn:

npm i --save vamtiger-is-remote-url

or

yarn add vamtiger-is-remote-url

Usage

Import or require a referece to VAMTIGER Is Remote URL:

import isRemoteUrl from 'vamtiger-is-remote-url';

or

const isRemoteUrl = require('vamtiger-is-remote-url').default;

VAMTIGER Is Remote URL will return true for a valid remote url:

const isRemoteUrl = require('vamtiger-is-remote-url').default;

const url = 'https://some/https/url';

isRemoteUrl({ url })
    // .then(result => handleResult(result)) // result = true
    // .catch(handleError)

Otherwise, it will return false:

const isRemoteUrl = require('vamtiger-is-remote-url').default;

const url = 'some/relative/file/path.ext';

isRemoteUrl({ url })
    // .then(result => handleResult(result)) // result = false
    // .catch(handleError)

Since VAMTIGER Is Remote URL returns a Promise, the result can be more conveniently referenced within an async function:

async someAsyncFunction function() {
    const remoteUrl = await isRemoteUrl({ url });
}

About

A regular expression to match a remote URL for defined HTML document text.

Resources

License

Stars

Watchers

Forks

Packages

No packages published