JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 32
  • Score
    100M100P100Q55743F
  • License MIT

A package to check if a URL is an image URL or not and also get the valid image link from it

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (verify-image-url) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    verify-image-url

    A package to check if a URL is an image URL or not and also get the valid image link from it

    Install

    $ npm i verify-image-url

    Example

    const { verifyImageURL } = require('verify-image-url');
    
    await verifyImageURL('https://example.com/example.png');
    // -> { isImage: true, imageURL: 'https://example.com/example.png' }
    
    await verifyImageURL('https://example.com/example.png', { timeout: 10000 }); // Sets timeout to 10 seconds, default is 5
    
    await verifyImageURL('https://prnt.sc/zrfn0r');
    // -> { isImage: true, imageURL: 'https://image.prntscr.com/image/-ndZGuDMRfu7oDAR-fESzg.png' }
    // This link is from og:image meta tag since prnt.sc is a site where you can upload screenshots and get the web page url from it which isn't your image link but it's in the meta tag