PHPackages                             vanbrabantf/npm-stat-fetcher - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vanbrabantf/npm-stat-fetcher

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vanbrabantf/npm-stat-fetcher
============================

A small package that returns some common stats about npm packages

1.0.0(8y ago)7142[1 issues](https://github.com/vanbrabantf/npm-stat-fetcher/issues)MITPHPPHP ^7.0

Since Oct 15Pushed 8y ago2 watchersCompare

[ Source](https://github.com/vanbrabantf/npm-stat-fetcher)[ Packagist](https://packagist.org/packages/vanbrabantf/npm-stat-fetcher)[ RSS](/packages/vanbrabantf-npm-stat-fetcher/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/294e58a1575d80b1d8737c51ef05f15f07472bb067ae165f3850420b81d9a780/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f76616e62726162616e74662f6e706d2d737461742d666574636865722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/vanbrabantf/npm-stat-fetcher/?branch=master)[![Build Status](https://camo.githubusercontent.com/c0be7c2b930ebd03d6ab20edd364c3c56cb4fab981e64af64b5f8018351a9e71/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f76616e62726162616e74662f6e706d2d737461742d666574636865722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/vanbrabantf/npm-stat-fetcher/build-status/master)

Purpose
-------

[](#purpose)

A simple package written in PHP that fetches statistics from NPM. It's mostly a wrapper around the NPM-API.

Installation
------------

[](#installation)

Installation can be done easily through composer.

```
composer require vanbrabantf/npm-stat-fetcher

```

Usage
-----

[](#usage)

**tl;dr:** Usage of the package is pretty simple, just pass the name of the `npm` package you would like to get the stats off to the methods inside of the `StatFetcher` class.

You can import the class like this:

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

### Available methods

[](#available-methods)

Will return the downloads of the previous day:

```
$statFetcher->getDownloadsLastDay('jquery');
```

Will return the downloads of the previous week:

```
$statFetcher->getDownloadsLastWeek('jquery');
```

Will return the downloads of the previous month:

```
$statFetcher->getDownloadsLastMonth('jquery');
```

Will return the downloads of the previous year:

```
$statFetcher->getDownloadsLastYear('jquery');
```

Will return the total downloads:

```
$statFetcher->getDownloads('jquery');
```

Will return the total downloads between 2 dates:

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

### What it will return

[](#what-it-will-return)

The methods will return `DownloadStatistics` objects. These are value objects that have values for the dates, download counts and package information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3134d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ed4e4a091b40ebbd3803c2c7fac80136575ee15c8e3426096ef296a49fdb18af?d=identicon)[vanbrabantf](/maintainers/vanbrabantf)

---

Top Contributors

[![vanbrabantf](https://avatars.githubusercontent.com/u/12281411?v=4)](https://github.com/vanbrabantf "vanbrabantf (48 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (11 commits)")[![WouterSioen](https://avatars.githubusercontent.com/u/1398405?v=4)](https://github.com/WouterSioen "WouterSioen (7 commits)")[![Dylan-DPC](https://avatars.githubusercontent.com/u/99973273?v=4)](https://github.com/Dylan-DPC "Dylan-DPC (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vanbrabantf-npm-stat-fetcher/health.svg)

```
[![Health](https://phpackages.com/badges/vanbrabantf-npm-stat-fetcher/health.svg)](https://phpackages.com/packages/vanbrabantf-npm-stat-fetcher)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
