1.1.2 • Published 2 years ago

detect-link-type v1.1.2

Weekly downloads
4
License
MIT
Repository
github
Last release
2 years ago

detect-link-type

Detects the type of a link, getting the extension of a provided link, in ES2015.

Installation

$> npm i -S detect-link-type

Usage

Typescript

import { Detector } from 'detect-link-type';

Javascript

const { Detector } = require('detect-link-type');

API docs

const LINK = "http://example.com/1/2/3/a.png";

Detector.getExtension(LINK); // "png"
Detector.isImage(LINK); // true
Detector.isPNG(LINK); // true
Detector.isGIF(LINK); // false
Detector.isJPG(LINK); // false
Detector.isCSS(LINK); // false
Detector.isHTML(LINK); // false
Detector.isTTF(LINK); // false
Detector.isJS(LINK); // false
Detector.isPDF(LINK); // false

Credits

Juan Camilo Guarin P
Otherwise SAS
http://owsas.com

LICENSE

MIT

1.1.2

2 years ago

1.1.1

4 years ago

1.0.6

5 years ago

1.0.4

5 years ago

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago