Scarf is like Google Analytics for your npm packages. By sending some basic details after installation, this package can help you can gain insights into how your packages are installed and by which companies. Scarf aims to help support open-source developers fund their work when used commercially.
You'll first need to create a library entry on Scarf. Once created, add a dependency on this library to your own:
npm i --save @scarf/scarf
Once your library is published to npm with this change, Scarf will automatically collect stats on install, no additional code is required!
Head to your package's dashboard on Scarf to see your reports when available.
- Basic system information of your users
- Company information of your users
- Dependency tree information of packages that depend on your library
- The operating system you are using
- The version of the package you're installing that depends on Scarf
- Your IP address will be used to look up any available company information. The IP address itself will be subsequently deleted
Scarf's analytics help support developers of the open source packages you are using, so and leaving the anlytics enabled is appreciated. However, if you'd like to opt out, set this variable in your environment:
export SCARF_NO_ANALYTICS=1
Future releases of scarf-js will provide a module of utility functions to collect usage analytics in addition to the current installation analytics.