evidence-connector-npm-stats

0.0.1 • Public • Published

Evidence NPM Stats Datasource

This package makes npm download statistics available as an Evidence datasource.

Specify a package that you want download stats for and this datasource will return daily downloads.

Schema

Tables

Table Name Description
last_day Daily downloads for the last day
last_week Daily downloads for the last week
last_month Daily downloads for the last month
last_year Daily downloads for the last year
max_range Daily downloads for max range (currently 550 days)

Columns

Each table has the same columns:

Column Name Type Description
downloads number The number of downloads for that day
day date The date of the downloads

Installing

  1. Install the package
npm install evidence-connector-npm-stats
  1. Add the datasource to your evidence.plugins.yaml
datasources:
  "evidence-connector-npm-stats": { }
  1. Start the development server, navigate to localhost:3000/settings and add a new datasource. You should see "npm-stats" as an option.

  2. Add the package name you want to track to the datasource settings.

Adding a package name

TODO: [Recommended] Write Unit Tests

This template comes with vitest pre-installed. If you've used jest, vitest implements a very similar API.

Tests have been stubbed in index.spec.js, and can be run with npm run test

Typescript has also been included with a basic configuration, and your types can be checked with npm run check

Package Sidebar

Install

npm i evidence-connector-npm-stats

Weekly Downloads

9

Version

0.0.1

License

MIT

Unpacked Size

108 kB

Total Files

7

Last publish

Collaborators

  • archiewood