npm.io
1.2.10 • Published 3 months ago

reo-census

Licence
MIT
Version
1.2.10
Deps
0
Size
27 kB
Vulns
0
Weekly
0
Install scriptsThis package runs scripts during installation (preinstall/install/postinstall)

reo-census

Track installations of your npm package.

Setup

Add reo-census to your package.json dependencies:

{
  "name": "your-package",
  "version": "1.0.0",
  "dependencies": {
    "reo-census": "^1.2.9"
  }
}

That's it. Every time someone installs your package, installation data is collected and sent to your configured telemetry endpoint automatically.

Optional Configuration

By default, tracking works out of the box with no configuration needed. You can optionally customize behavior by adding a reoSettings block to your package.json:

{
  "name": "your-package",
  "version": "1.0.0",
  "reoSettings": {
    "defaultOptIn": true,
    "endpoint": "https://your-telemetry-endpoint.example.com/data",
    "dataMode": "partial"
  },
  "dependencies": {
    "reo-census": "^1.2.9"
  }
}
Settings
  • defaultOptIn (boolean, default: true)
    • true — tracking is enabled by default
    • false — tracking is disabled unless the end user opts in
  • endpoint (string, optional)
    • The URL where tracking data is sent
    • Defaults to the built-in telemetry endpoint
  • dataMode (string, default: "partial")
    • "partial" — sends email domain only, no full email, no dependency list
    • "full" — sends full email and dependency list

Data Collected

Each installation sends a JSON payload with:

  • Package name and version
  • OS platform, architecture, Node.js version
  • Install timestamp
  • Git username and email domain (partial mode) or full email (full mode)

Opt-Out for End Users

End users can disable tracking by setting an environment variable before installing:

PACKAGE_TRACKER_ANALYTICS=false npm install

Keywords