Resource for NPM's most downloaded this week/month

后端 未结 2 1020
醉酒成梦
醉酒成梦 2021-02-20 18:41

Are there any sites that display this weeks/months most popular modules from Node Package Manger (NPM).

I know www.npmjs.com have packages people \'npm install\' a

2条回答
  •  感情败类
    2021-02-20 19:38

    Here’s most depended upon

    var cheerio = require('cheerio');
    var request = require('request');
    
    request('https://www.npmjs.com/browse/depended', function (err, res, body) {
      if (err) return false;
      var $ = cheerio.load(body);
      $('h3 a').each(function () {
        console.log($(this).html() + ' - ' + $(this).attr('href'));
      });
    });
    

提交回复
热议问题