83trust / 100

Npm Exports Check

by code.halowerk.com in Developer tools

x402 APIPassing, checked 3 h ago

Lint an npm package tarball with publint and resolve every "exports" subpath for node import/require, TypeScript and browser bundlers, reporting missing files and missing type declarations. Takes a published npm package (name plus exact version or dist-tag, fetched only from https://registry.npmjs.org with dist.integrity check, at most 8 MiB compressed) or a .tgz as base64 (e.g. the output of npm pack).

POST
https://code.halowerk.com/v1/npm-exports-check
Price
$0.005
per call in USDC
Uptime
98.4%
last 30 days
Response time
159 ms
272 ms slowest 5%
Last check
Passed
3 h ago, next any minute now

Run a free test callHow to call it

Reliability

All checks passedSome failedAll failedNot checked

Status and outage history · Atom feed · Watch with other listings

How to call it

POST https://code.halowerk.com/v1/npm-exports-check

Each call costs $0.005 in USDC on Base, paid with the request over x402.

Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.

Example request

From the listing.

POST https://code.halowerk.com/v1/npm-exports-check
content-type: application/json

{
  "package": "ms",
  "version": "2.1.3"
}

Parameters

ParameterTypeRequiredDescription
levelstringNo One of: suggestion, warning, error. Default: "suggestion".
packagestringNo
strictbooleanNo Default: false.
tarball_base64stringNo
versionstringNo

Example response

The provider's example. We can't check it without paying.

Example response, 67 lines
{
  "limitations": [
    "Type resolution checks that a declaration file exists where TypeScript (node16 conditions) would look and that its module format (by extension and nearest package.json type) matches what Node loads; it does not run the TypeScript compiler, so wrong declaration contents and typesVersions redirects are not detected as arethetypeswrong would.",
    "Lifecycle scripts and package code are never executed; publint cannot flag files that exist in the source repository but are missing from the tarball, because only the tarball is known."
  ],
  "result": {
    "exports": {
      "entries": [],
      "has_declarations": false,
      "legacy": {
        "main": "index.js",
        "main_format": "cjs",
        "module": null,
        "types": null
      },
      "present": false,
      "problems": [],
      "subpaths": 0
    },
    "ok": true,
    "package": {
      "name": "ms",
      "type": "commonjs",
      "version": "2.1.3"
    },
    "publint": {
      "errors": 0,
      "messages": [
        {
          "code": "USE_TYPE",
          "message": "The package does not specify the \"type\" field. Node.js may attempt to detect the package type causing a small performance hit. Consider adding \"type\": \"commonjs\".",
          "path": "name",
          "type": "suggestion"
        },
        {
          "code": "USE_ENGINES_NODE",
          "message": "The package does not specify the \"engines.node\" field. Consumers may install it on an unsupported Node.js version. Consider adding the field with your actual minimum supported Node.js version. (This may be a breaking change)",
          "path": "name",
          "type": "suggestion"
        }
      ],
      "suggestions": 2,
      "version": "0.3.25",
      "warnings": 0
    },
    "tarball": {
      "compressed_bytes": 2967,
      "entries": 4,
      "files": 4,
      "integrity": {
        "algorithm": "sha512",
        "ok": true
      },
      "links_not_followed": [],
      "pax_headers": false,
      "root_dirs": [
        "package"
      ],
      "skipped_entries": 0,
      "source": "registry.npmjs.org",
      "tarball_url": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
      "unpacked_bytes": 6721
    }
  },
  "service": "npm-exports-check",
  "status": "success"
}

Call it from code

The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.005.

curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i -X POST 'https://code.halowerk.com/v1/npm-exports-check' \
  -H 'content-type: application/json' \
  --data-raw '{"package":"ms","version":"2.1.3"}'

# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - -X POST 'https://code.halowerk.com/v1/npm-exports-check' \
  -H 'content-type: application/json' \
  --data-raw '{"package":"ms","version":"2.1.3"}' \
  | grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decode
JavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

// Pays at most $0.005 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.005" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.005 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fcode.halowerk.com%2Fv1%2Fnpm-exports-check&method=POST
const res = await pay("https://code.halowerk.com/v1/npm-exports-check", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    "package": "ms",
    "version": "2.1.3"
  }),
});
console.log(res.status, await res.text());
Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

# Pays at most $0.005 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.005"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))

with x402_requests(client) as session:
    res = session.post(
        "https://code.halowerk.com/v1/npm-exports-check",
        json={
            "package": "ms",
            "version": "2.1.3",
        },
    )
    print(res.status_code, res.text)

Security scan

No findings

We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
3 h agoPassed402124 ms$0.005
14 h agoPassed402120 ms$0.005
24 h agoPassed402125 ms$0.005
35 h agoPassed40239 ms$0.005
44 h agoPassed402142 ms$0.005
Show 10 older checks
2 days agoPassed40239 ms$0.005
3 days agoPassed402175 ms$0.005
5 days agoTimed out---
6 days agoPassed402154 ms$0.005
7 days agoPassed402133 ms$0.005
7 days agoPassed402127 ms$0.005
7 days agoPassed402127 ms$0.005
8 days agoPassed402259 ms$0.005
8 days agoPassed402117 ms$0.005
8 days agoPassed402122 ms$0.005