diff --git a/README.md b/README.md index fc7e18a..573acdd 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,11 @@ Alternatively, you can set this variable in your environment: export SCARF_ANALYTICS=false ``` +You can also set this variable in accordance to the [Console Do Not Track](https://consoledonottrack.com/) standard: +```shell +export DO_NOT_TRACK=1 +``` + Either route will disable Scarf for all packages. #### I distribute a package on npm, and scarf-js is in our dependency tree. Can I disable the analytics for my downstream dependents? diff --git a/report.js b/report.js index 34314df..9b1c487 100644 --- a/report.js +++ b/report.js @@ -55,7 +55,7 @@ function logIfVerbose (toLog, stream) { // SCARF_NO_ANALYTICS was the original variable, we'll get rid of it eventually const userHasOptedOut = (rootPackage) => { return (rootPackage && rootPackage.scarfSettings && rootPackage.scarfSettings.enabled === false) || - (process.env.SCARF_ANALYTICS === 'false' || process.env.SCARF_NO_ANALYTICS === 'true') + (process.env.SCARF_ANALYTICS === 'false' || process.env.SCARF_NO_ANALYTICS === 'true' || process.env.DO_NOT_TRACK === '1') } const userHasOptedIn = (rootPackage) => {