# NPM Package Analyzer (`gochujang/npm-package-analyzer`) Actor

Analyze npm packages in depth: weekly/monthly downloads, bundle size (raw + gzip via Bundlephobia), security vulnerabilities, version history, dependencies count, license, author, and repository link. Batch up to 50 packages per run with full async parallelism. No API key required.

- **URL**: https://apify.com/gochujang/npm-package-analyzer.md
- **Developed by:** [Hojun Lee](https://apify.com/gochujang) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 package analyzeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What does NPM Package Analyzer do?

**NPM Package Analyzer** pulls comprehensive metrics for any list of npm packages in a single run — no API key required. It combines data from the **npm registry**, the **npm Downloads API**, **Bundlephobia** (bundle size), and the **npm Security Advisories API** to give you a full picture of every package: download trends, bundle size, known CVEs, dependency count, version history, and maintainer details.

This is the definitive **npm package metrics** tool for developers, security engineers, and decision-makers who need objective package health data before adding a dependency or auditing their existing stack.

***

### Why use NPM Package Analyzer?

**Audit npm packages** for security, popularity, and maintenance health without writing your own API integration or stitching together multiple CLI tools.

1. **Dependency due diligence** — Before adding a new library, run an **npm security audit** alongside download stats and bundle size to make an informed decision. Catch abandoned packages and known CVEs before they enter your codebase.
2. **Supply chain security monitoring** — Security teams can schedule weekly scans of their production dependency list and alert on newly disclosed vulnerabilities or packages with zero recent downloads (potential abandonment).
3. **Node.js package metrics for engineering reports** — Engineering managers can track which internal or external packages are growing in adoption versus declining, and report bundle size trends across quarters.
4. **Open-source investment research** — Analysts tracking OSS ecosystems can monitor **npm package download trends** as a proxy for developer mindshare and platform adoption velocity.
5. **Tech stack migration planning** — Compare two competing packages (e.g. `moment` vs `date-fns`) across downloads, bundle size, vulnerabilities, and last-publish date to justify migration decisions with data.

***

### How to use NPM Package Analyzer

1. Open the actor on Apify and click **Try for free**.
2. Enter your list of **package names** (e.g. `["express", "lodash", "axios"]`).
3. Toggle optional sections:
   - **Include Bundle Size** — fetches minified + gzipped size from Bundlephobia.
   - **Include Vulnerabilities** — checks npm Security Advisories for known CVEs.
   - **Include Download Trend** — fetches weekly and monthly download counts.
4. Set **Max Version History** (1–50 recent versions).
5. Click **Start** and retrieve results from the dataset.

***

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `packages` | array | *(required)* | List of npm package names to analyze (e.g. `["react", "vue", "lodash"]`). |
| `includeBundleSize` | boolean | `true` | Fetch minified and gzipped bundle size from Bundlephobia. |
| `includeVulnerabilities` | boolean | `true` | Check npm Security Advisories for known CVEs and severity ratings. |
| `includeDownloadTrend` | boolean | `true` | Fetch weekly and monthly download counts from the npm Downloads API. |
| `maxVersions` | integer | `10` | Maximum number of recent versions to include in version history (1–50). |

***

### Output

Each item in the dataset represents one **analyzed npm package**.

```json
[
  {
    "name": "axios",
    "version": "1.7.2",
    "description": "Promise based HTTP client for the browser and node.js",
    "homepage": "https://axios-http.com",
    "license": "MIT",
    "author": "Matt Zabriskie",
    "maintainers": ["jasonsaayman", "nickuraltsev"],
    "repository": "https://github.com/axios/axios",
    "downloads_last_week": 48293812,
    "downloads_last_month": 192847300,
    "bundle_size_minified_bytes": 45678,
    "bundle_size_gzipped_bytes": 14231,
    "dependencies_count": 4,
    "dev_dependencies_count": 22,
    "vulnerabilities": [],
    "last_published_at": "2024-04-15T12:30:00Z",
    "version_history": [
      {"version": "1.7.2", "published_at": "2024-04-15T12:30:00Z"},
      {"version": "1.7.1", "published_at": "2024-03-20T09:00:00Z"}
    ],
    "analyzed_at": "2026-09-02T10:15:00Z"
  },
  {
    "name": "left-pad",
    "version": "1.3.0",
    "downloads_last_week": 12847,
    "downloads_last_month": 51034,
    "vulnerabilities": [],
    "last_published_at": "2017-03-22T00:00:00Z",
    "analyzed_at": "2026-09-02T10:15:00Z"
  }
]
```

***

### Data fields

| Field | Type | Description |
|-------|------|-------------|
| `name` | string | npm package name |
| `version` | string | Latest published version |
| `description` | string | Package description from registry |
| `homepage` | string | Project homepage URL |
| `license` | string | SPDX license identifier |
| `author` | string | Primary author name |
| `maintainers` | array | List of npm maintainer usernames |
| `repository` | string | Source code repository URL |
| `downloads_last_week` | integer | **Weekly download count** from npm Downloads API |
| `downloads_last_month` | integer | Monthly download count |
| `bundle_size_minified_bytes` | integer | Minified bundle size in bytes (Bundlephobia) |
| `bundle_size_gzipped_bytes` | integer | **Gzipped bundle size** in bytes |
| `dependencies_count` | integer | Number of production dependencies |
| `dev_dependencies_count` | integer | Number of dev dependencies |
| `vulnerabilities` | array | Known CVEs from npm Security Advisories with severity rating |
| `last_published_at` | string | Timestamp of most recent publish to npm |
| `version_history` | array | Recent versions with publish timestamps |
| `analyzed_at` | string | ISO 8601 timestamp of the analysis run |

***

### Cost estimation

This actor uses **Pay-Per-Event (PPE)** pricing.

| Scenario | Packages | Cost |
|----------|----------|------|
| Single package audit | 1 | $0.008 |
| Small project (10 packages) | 10 | $0.035 |
| Full dependency audit (50 packages) | 50 | $0.155 |
| Large monorepo (200 packages) | 200 | $0.605 |

**Pricing breakdown:**

- $0.005 — actor start (one-time per run)
- $0.003 — per **npm package** successfully analyzed

***

### FAQ

**Does this actor require an npm API key or login?**
No. The **npm package analyzer** uses only public APIs: the npm registry (`registry.npmjs.org`), npm Downloads API, Bundlephobia, and npm Security Advisories. No authentication is required.

**How current is the vulnerability data?**
Vulnerability data comes from the official npm Security Advisories API, which is the same source powering `npm audit`. It reflects the current state of the advisory database at the time of the run. Schedule the actor weekly to catch newly disclosed CVEs.

**Can I analyze private or scoped packages?**
Scoped packages (e.g. `@company/package`) are fully supported — just include the full scoped name in your list. Private registry packages are not supported; the actor only queries the public npm registry.

***

> **Disclaimer:** This actor uses public APIs including the npm registry, npm Downloads API, Bundlephobia, and npm Security Advisories. Vulnerability data is advisory only and does not guarantee a package is secure or insecure. Always perform your own security due diligence before making production dependency decisions. This actor is not affiliated with or endorsed by npm, Inc. or GitHub, Inc.

***

### Related actors

- [NPM Package Trends](https://apify.com/gochujang/npm-package-trends) — Download trend sparklines for packages analyzed by this actor
- [NPM Package Security Scanner](https://apify.com/gochujang/npm-package-security-scanner) — Deeper CVE and supply chain risk for packages identified as vulnerable here
- [GitHub Repo Analytics](https://apify.com/gochujang/github-repo-analytics) — GitHub stars and contributor activity for the source repos of npm packages

### Feedback

If this actor powers your dependency research, a review helps others find it: [Leave a review on Apify Store](https://apify.com/gochujang/npm-package-analyzer#reviews)

***

**Keywords:** npm package analyzer, npm dependency audit, bundle size checker, npm package metadata, package.json analyzer, npm vulnerability check, tree-shaking analysis, npm license checker, direct dependencies, peer dependencies, npm registry scraper, JavaScript package health, npm package quality, dependency tree, package maintenance score

# Actor input Schema

## `packages` (type: `array`):

List of npm package names to analyze (e.g. react, lodash, express). Max 50.

## `includeDepTree` (type: `boolean`):

If true, fetch and include the full list of package dependencies (from package metadata).

## `includeBundleSize` (type: `boolean`):

Fetch minified and gzip bundle sizes from Bundlephobia.

## `includeVulnerabilities` (type: `boolean`):

Check npm security advisories for known CVEs.

## `includeDownloadTrend` (type: `boolean`):

Fetch weekly and monthly download counts from npm download API.

## `maxVersions` (type: `integer`):

Maximum number of recent versions to include in version history (1-50).

## Actor input object example

```json
{
  "packages": [
    "react",
    "lodash",
    "express"
  ],
  "includeDepTree": false,
  "includeBundleSize": true,
  "includeVulnerabilities": true,
  "includeDownloadTrend": true,
  "maxVersions": 10
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gochujang/npm-package-analyzer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("gochujang/npm-package-analyzer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call gochujang/npm-package-analyzer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gochujang/npm-package-analyzer"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/gEwrYfBQtyaKkHeRF/builds/qsIvdFxGgCc8hJ8Lh/openapi.json
