Developmint/npm-stats-api

Get alltime stats

freekmurze opened this issue · 1 comments

Is it possible to get stats starting from a given date? Eg. give me a total of downloads of a package starting from 1/1/2014?

Yeah, this is possible by using a range from 1/1/2015 (which is the earliest date provided) to the current date (which can be found out programmatically):

$currentDate = (new \DateTime)->format("Y-m-d");
$npmStats->getStats('vue-save-state', "2015-01-01:{$currentDate}");

PS: I'll add a passing test for that one in a second.