npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@lyuboslavlyubenov/logo-scrape

v1.2.0

Published

Scrapes/Crawls the logo from a provided url(s)/website for your Node.js applications.

Downloads

2

Readme

Table of Contents

Installation

$ npm i logo-scrape

Import

NodeJS

const { LogoScrape } = require('logo-scrape');

TypeScript

import { LogoScrape } from 'logo-scrape';

Usage

getLogo() or getLogos() accepts a url(s) and returns the output for the provided url(s)

(async () => {
    const url = 'http://techcrunch.com';
    const logo = await LogoScrape.getLogo(url);
    const logos = await LogoScrape.getLogos(url);
    console.log({logo, logos});
    
    const urls = ['http://techcrunch.com' , 'http://producthunt.com'];
    const logoUrls = await LogoScrape.getLogo(urls);
    const logosUrls = await LogoScrape.getLogos(urls);
    console.log({logoUrls, logosUrls});
})();

Will output below result;

{
  "logo": {
    "type": "link-rel/icon",
    "url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w=32",
    "size": "32x32"
  },
  "logos": [
    {
      "type": "link-rel/icon",
      "url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w=32",
      "size": "32x32"
    },
    {
      "type": "link-rel/icon",
      "url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w=192",
      "size": "192x192"
    },
    {
      "type": "link-rel/icon",
      "url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w=180"
    },
    {
      "type": "meta-name/msapplication-TileImage",
      "url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w=270"
    },
    {
      "type": "og:image",
      "url": "https://techcrunch.com/wp-content/themes/techcrunch-2017/images/opengraph-default.png"
    }
  ]
}

And for multiple url's

{
  "logoUrls": [
    {
      "type": "link-rel/icon",
      "url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w=32",
      "size": "32x32"
    },
    {
      "type": "link-rel/icon",
      "url": "https://assets.producthunt.com/assets/ph-ios-icon-e1733530a1bfc41080db8161823f1ef262cdbbc933800c0a2a706f70eb9c277a.png"
    }
  ],
  "logosUrls": [
    [
      {
        "type": "link-rel/icon",
        "url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w=32",
        "size": "32x32"
      },
      {
        "type": "link-rel/icon",
        "url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w=192",
        "size": "192x192"
      },
      {
        "type": "link-rel/icon",
        "url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w=180"
      },
      {
        "type": "meta-name/msapplication-TileImage",
        "url": "https://techcrunch.com/wp-content/uploads/2015/02/cropped-cropped-favicon-gradient.png?w=270"
      },
      {
        "type": "og:image",
        "url": "https://techcrunch.com/wp-content/themes/techcrunch-2017/images/opengraph-default.png"
      }
    ],
    [
      {
        "type": "link-rel/icon",
        "url": "https://assets.producthunt.com/assets/ph-ios-icon-e1733530a1bfc41080db8161823f1ef262cdbbc933800c0a2a706f70eb9c277a.png"
      },
      {
        "type": "link-rel/icon",
        "url": "https://www.producthunt.com/favicon.ico"
      },
      {
        "type": "og:image",
        "url": "https://www.producthunt.comhttps://api.url2png.com/v6/P5329C1FA0ECB6/790272390317dc724643b1ca88f5da6e/png/?url=https%3A%2F%2Fwww.producthunt.com%2F"
      },
      {
        "type": "svg:image",
        "data": true,
        "url": "data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Cpath%20d%3D%22M40%2020c0%2011.046-8.954%2020-20%2020S0%2031.046%200%2020%208.954%200%2020%200s20%208.954%2020%2020%22%20fill%3D%22%23DA552F%22%2F%3E%3Cpath%20d%3D%22M22.667%2020H17v-6h5.667a3%203%200%200%201%200%206m0-10H13v20h4v-6h5.667a7%207%200%201%200%200-14%22%20fill%3D%22%23FFF%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"
      }
    ]
  ]
}

API

The API generated with TypeDoc can be found here.

Demo

Contributing

Feel free to submit pull requests, create issues or spread the word.

License

MIT © Fritz Hoste