streamable-validate

1.0.1 • Public • Published

streamable-validate

Checks the validity of Streamable URLs.


Installation

npm install streamable-validate

URL Validity

Valid URLs are streamable URLs that link to an existing video. Codes are case sensitive.

Examples

const valid1 = "streamable.com/(valid code)"
const valid2 = "wwww.streamable.com/(valid code)"
const valid3 = "https://streamable.com/(valid code)"
const valid4 = "https://www.streamable.com/(valid code)"
const valid5 = "STREAMABLE.COM/(valid code)"

Invalid Examples

const invalid1 = "not-streamable-link"
const invalid2 = "streamable.com"
const invalid3 = "streamable.com/(invalid code)"

Usage

Function will return the video's ID if it is valid.

const {validateStreamableURL} = require('streamable-validate')

validateStreamableURL(url)
    .then (response => {
        // do something
    })
    .catch (error => {
        // handle error
    })

Function will get the ID from a URL.

const {streamableIdFromURL} = require('streamable-validate')

const urlId = streamableIdFromURL(url) 

Readme

Keywords

Package Sidebar

Install

npm i streamable-validate

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

3.22 kB

Total Files

3

Last publish

Collaborators

  • bradley-03