PHP code example of vanbrabantf / npm-stat-fetcher

1. Go to this page and download the library: Download vanbrabantf/npm-stat-fetcher library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vanbrabantf / npm-stat-fetcher example snippets


$statFetcher = new Vanbrabantf\NpmStatFetcher\StatFetcher();

$statFetcher->getDownloadsLastDay('jquery');

$statFetcher->getDownloadsLastWeek('jquery');

$statFetcher->getDownloadsLastMonth('jquery');

$statFetcher->getDownloadsLastYear('jquery');

$statFetcher->getDownloads('jquery');

$start = new DateTime('1989-12-13');
$end = new DateTime('1988-11-07');
$statFetcher->getDownloadsBetweenDates('jquery', $start, $end);