vamtiger-is-remote-url
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

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 });
}

Readme

Keywords

Package Sidebar

Install

npm i vamtiger-is-remote-url

Weekly Downloads

1

Version

0.0.10

License

MIT

Unpacked Size

11.7 kB

Total Files

18

Last publish

Collaborators

  • vamtiger-project