# npm Manifest Deprecation & License Change Feed (`natstandridge/npm-deprecation-license-change-feed`) Actor

Check direct package.json dependencies against public npm Registry version metadata. Compare declared licenses and deprecation notices with a prior delivered snapshot.

- **URL**: https://apify.com/natstandridge/npm-deprecation-license-change-feed.md
- **Developed by:** [Nathaniel Standridge](https://apify.com/natstandridge) (community)
- **Categories:** Developer tools, Open source
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 completed npm package metadata checks

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

## npm Manifest Deprecation & License Change Feed

Check a bounded set of direct `package.json` dependencies against the public npm Registry. Each delivered package row records the current `latest` tag's publisher-declared license and deprecation message, plus the same fields for an optional exact resolved version. Give the next run `OUTPUT.snapshot` from a prior run to see field-by-field changes.

### Input

Paste the dependency sections from `package.json` into `manifest`: `dependencies`, `devDependencies`, `optionalDependencies`, and `peerDependencies`. The Actor checks each unique package name once even when it appears in multiple sections, and preserves each declared spec in `manifestSpecs`. It accepts an empty manifest. It rejects invalid names, unknown fields, oversize input, and non-exact `resolvedVersions`. These names form only fixed npm Registry URLs; the Actor never fetches a user-supplied URL, repository URL, tarball or metadata link.

To check the version actually installed, supply a `resolvedVersions` object with exact semver values from your lockfile. A manifest range such as `^7.0.0` is **not** resolved or assumed installed. For example:

```json
{
  "manifest": {"dependencies": {"is-number": "^7.0.0"}},
  "resolvedVersions": {"is-number": "7.0.0"}
}
```

For recurring runs, copy the `snapshot` array from the previous run's `OUTPUT` record into `previousSnapshot`. A package with no prior row is `first_seen`; a matching metadata state is `unchanged`; otherwise the row is `changed` and `changes` lists before/after values. `first_seen` does not mean the package was newly published. Missing packages are never labeled removed. A failed or undelivered package retains its prior snapshot, so a partial run cannot silently mark it checked.

`examples/input.json` is a live public-source example. `examples/synthetic-input.json` and `examples/synthetic-output.json` are an invented fixture illustrating the contract; they do not claim that package exists in the registry.

### Output and limitations

The default dataset contains one row per successfully checked package. It includes exact source URLs, UTC observation time, publisher-declared fields and comparison evidence. The separate `OUTPUT` record reports requested, attempted, read and delivered counts; per-package coverage and errors; and the next snapshot. Source errors, redirects, invalid responses and unattempted names produce no dataset row or per-row charge.

Only public, direct npm dependencies are covered. No transitive dependency traversal, security-vulnerability finding, license text inspection, legal license conclusion, private registry access, or evidence that a declaration matches the package payload is claimed. The `latest` tag and metadata are read sequentially and may change between requests. A `null` license with `missing` or `unsupported_format` has a different meaning from an asserted license string.

The Actor requests only documented public version metadata `GET /{package}/{version}` endpoints at `registry.npmjs.org`. It uses HTTPS without redirects, authentication, proxies or package-supplied links; validates response name/version/shape; caps the body at 512 KiB and per-request timeout at 2–15 seconds; and makes at most one retry for transient status or network failures. See [npm Registry API](https://github.com/npm/registry/blob/main/docs/REGISTRY-API.md), [package metadata fields](https://github.com/npm/registry/blob/main/docs/responses/package-metadata.md), and [npm deprecation behavior](https://docs.npmjs.com/deprecating-and-undeprecating-packages-or-package-versions/).

### Bounds and billing

Input is capped at 256 KiB, 200 declarations and 100 distinct packages. `maxPackages` is 1–100 attempted packages, `maxRunSeconds` is 30–180, and `requestTimeoutSeconds` is 2–15. Set the platform run timeout at least 120 seconds above the work budget for storage and shutdown. No npm request is made when the remaining native charge budget is zero. A smaller charge cap or package limit produces explicit partial coverage.

Proposed price: **$1 per 1,000 delivered package rows** ($0.001 each), including unchanged observations. Each successful row uses only Apify's native `apify-default-dataset-item` event. An `OUTPUT` summary or error is uncharged. The result plan is frozen before writes; existing dataset rows and native charged-event counts must match that plan on restart. Dataset writes disable client retries, record a pending checkpoint, and stop on an uncertain response. Reconcile the same run before trying another billable write. This is a price hypothesis, not an earnings or profit forecast; actual compute cost and paid retention must be measured.

### Development and qualification

From this directory, run `uv run --locked python -B -m unittest discover -s tests -v`. A read-only live source smoke is available through `uv run --locked python -B tools/local_smoke.py --input examples/input.json --output-dir ../../evidence/private/npm-deprecation-license-change-feed-local`. Keep raw outputs in ignored private evidence. The fixture tests cover valid, empty, malformed, duplicate and adversarial input; source metadata changes; caps; and lost-response/restart delivery.

Before publication, perform private cloud full, empty, mixed, capped and malformed runs from `examples/cloud-cases.json`. Save the exact run JSON, dataset, `OUTPUT` and `RESULT_PLAN` for each run, then use `tools/validate_cloud.py RUN_DIRECTORY examples/cloud-cases.json CASE`. Independently read back public npm version metadata for delivered rows and compare actual row values; inspect billed events and cost per delivered row. A successful run status alone is insufficient.

# Actor input Schema

## `manifest` (type: `object`):

Paste only dependencies, devDependencies, optionalDependencies and peerDependencies from package.json. Up to 100 unique public package names; duplicate names in sections are checked once. Ranges are recorded but not resolved.

## `resolvedVersions` (type: `object`):

Optional map from tracked package name to exact installed semver, e.g. from a lockfile. These versions are checked separately. Dependency ranges alone do not establish installed versions.

## `previousSnapshot` (type: `array`):

Paste OUTPUT.snapshot from a prior run to identify changed publisher-declared metadata. Without it, rows are first_seen. Only delivered rows advance this snapshot.

## `maxPackages` (type: `integer`):

Limit distinct public npm packages checked in this run to at most 100.

## `maxRunSeconds` (type: `integer`):

Stop source collection and delivery within this bounded work period.

## `requestTimeoutSeconds` (type: `integer`):

Maximum time allowed for each npm Registry response.

## Actor input object example

```json
{
  "manifest": {
    "dependencies": {
      "is-number": "^7.0.0",
      "@npmcli/arborist": "^9.0.0"
    }
  },
  "resolvedVersions": {},
  "previousSnapshot": [],
  "maxPackages": 100,
  "maxRunSeconds": 120,
  "requestTimeoutSeconds": 8
}
```

# Actor output Schema

## `checks` (type: `string`):

No description

## `summary` (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 = {
    "manifest": {
        "dependencies": {
            "is-number": "^7.0.0",
            "@npmcli/arborist": "^9.0.0"
        }
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("natstandridge/npm-deprecation-license-change-feed").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 = { "manifest": { "dependencies": {
            "is-number": "^7.0.0",
            "@npmcli/arborist": "^9.0.0",
        } } }

# Run the Actor and wait for it to finish
run = client.actor("natstandridge/npm-deprecation-license-change-feed").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 '{
  "manifest": {
    "dependencies": {
      "is-number": "^7.0.0",
      "@npmcli/arborist": "^9.0.0"
    }
  }
}' |
apify call natstandridge/npm-deprecation-license-change-feed --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,natstandridge/npm-deprecation-license-change-feed"
        }
    }
}
```

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/5qhgiPW6uFYshohgp/builds/P6300rhoiNWLcHrzd/openapi.json
