PHPackages                             sector27-gmbh/laravel-npm-health-checks - 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. [Security](/categories/security)
4. /
5. sector27-gmbh/laravel-npm-health-checks

ActiveLibrary[Security](/categories/security)

sector27-gmbh/laravel-npm-health-checks
=======================================

A Laravel Health check for npm audit advisories.

v0.1.0(2mo ago)0427↑400%MITPHP ^8.4

Since Apr 30Compare

[ Source](https://github.com/sector27-gmbh/laravel-npm-health-checks)[ Packagist](https://packagist.org/packages/sector27-gmbh/laravel-npm-health-checks)[ Docs](https://github.com/sector27-gmbh/laravel-npm-health-checks)[ GitHub Sponsors](https://github.com/:vendor_name)[ RSS](/packages/sector27-gmbh-laravel-npm-health-checks/feed)WikiDiscussions Synced 3w ago

READMEChangelogDependencies (17)Versions (4)Used By (0)

Laravel npm Health Checks
=========================

[](#laravel-npm-health-checks)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d433d971f3413ff16f4916db19cd994836cb40e446d1c24ed6af491884eb39e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736563746f7232372d676d62682f6c61726176656c2d6e706d2d6865616c74682d636865636b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sector27-gmbh/laravel-npm-health-checks)[![GitHub Tests Action Status](https://camo.githubusercontent.com/eb85d066b1351adeec7d7d53e8c00e172fd7f588571619e9686ca9512507e7dc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736563746f7232372d676d62682f6c61726176656c2d6e706d2d6865616c74682d636865636b732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/sector27-gmbh/laravel-npm-health-checks/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/1ab1635f7b19c51518f68367f1cb3f45a75eb5aa286df0bb6375770c811546bf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736563746f7232372d676d62682f6c61726176656c2d6e706d2d6865616c74682d636865636b732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/sector27-gmbh/laravel-npm-health-checks/actions/workflows/fix-php-code-style-issues.yml)[![Total Downloads](https://camo.githubusercontent.com/9dee5ace7ef33a2d542f02dfb2d5a3e0f0e4be9b5e267f89ace257448d0de214/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736563746f7232372d676d62682f6c61726176656c2d6e706d2d6865616c74682d636865636b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sector27-gmbh/laravel-npm-health-checks)

This package adds a [Laravel Health](https://github.com/spatie/laravel-health) check for npm security advisories. It runs `npm audit --json`, stores the parsed audit output as check meta, and reports warnings or failures based on configurable severity thresholds.

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

[](#installation)

You can install the package via composer:

```
composer require sector27-gmbh/laravel-npm-health-checks
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-npm-health-checks-config"
```

This is the contents of the published config file:

```
return [
    'paths' => [
        base_path(),
    ],

    'include_dev_dependencies' => false,

    'warning_threshold' => 'moderate',

    'failure_threshold' => 'high',

    'npm_binary' => 'npm',

    'timeout' => 60,
];
```

Usage
-----

[](#usage)

Register the check with Laravel Health:

```
use Sector27\LaravelNpmHealthChecks\NpmAuditCheck;
use Spatie\Health\Facades\Health;

Health::checks([
    NpmAuditCheck::new(),
]);
```

By default, the check audits production dependencies in your application root. It returns `ok` without a notification message when no vulnerabilities meet the warning threshold.

You may configure the check fluently:

```
Health::checks([
    NpmAuditCheck::new()
        ->atPaths([
            base_path(),
            base_path('resources/frontend'),
        ])
        ->includeDevDependencies()
        ->warnWhenSeverityIsAtLeast('moderate')
        ->failWhenSeverityIsAtLeast('high')
        ->timeout(120),
]);
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [sector27 GmbH](https://github.com/sector27-gmbh)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance83

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

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

85d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/280340283?v=4)[samsc27](/maintainers/samsc27)[@samsc27](https://github.com/samsc27)

---

Tags

laravelhealthsecurityAuditnpmsector27

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/sector27-gmbh-laravel-npm-health-checks/health.svg)

```
[![Health](https://phpackages.com/badges/sector27-gmbh-laravel-npm-health-checks/health.svg)](https://phpackages.com/packages/sector27-gmbh-laravel-npm-health-checks)
```

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M321](/packages/laravel-horizon)[spatie/laravel-health

Monitor the health of a Laravel application

87912.0M177](/packages/spatie-laravel-health)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

813336.8k3](/packages/defstudio-telegraph)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

45955.7k](/packages/harris21-laravel-fuse)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.6k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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