Skip to content

archiewood/npm-stats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

An Evidence connector to get npm package statistics from the npm API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published