New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

detect-link-type

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detect-link-type

Detects the type of a link

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 03 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc