helper-npm-downloads

0.1.1 • Public • Published

helper-npm-downloads NPM version Build Status

Get the npm download counts for the specified repository.

Install

Install with npm:

$ npm i helper-npm-downloads --save

Usage

var downloads = require('helper-npm-downloads');

Use with engine-base in templates

app.asyncHelper('downloads', downloads);

API

downloads

Get the npm download counts for the specified repository.

Params

  • repo {String}: Name of the repository to calculate download counts for.
  • options {Number|Object}: Additional options to control how many days back to get. May be a number specifying last N days.
  • options.last {Number}: Specify last N days to get downloads for. (Defaults to all downloads).
  • cb {Function}: Callback function with signature (err, total).

Example

<!-- when registered with `engine-base` as `downloads` -->
<%= downloads('micromatch') %>
<!-- 17985264 -->

Related projects

  • assemble: Assemble is a powerful, extendable and easy to use static site generator for node.js. Used… more | homepage
  • download-stats: Get and calculate npm download stats for npm modules. | homepage
  • engine: Template engine based on Lo-Dash template, but adds features like the ability to register helpers… more | homepage
  • engine-base: Default engine for Template. | homepage
  • generate: Fast, composable, highly extendable project generator with a user-friendly and expressive API. | homepage
  • npm-info: Base class for downloading data from the npm registry | homepage
  • templates: System for creating and managing template collections, and rendering templates with any node.js template engine.… more | homepage
  • verb: Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… more | homepage

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Brian Woodward

License

Copyright © 2016 Brian Woodward Released under the MIT license.


This file was generated by verb on January 22, 2016.

Package Sidebar

Install

npm i helper-npm-downloads

Weekly Downloads

2

Version

0.1.1

License

MIT

Last publish

Collaborators

  • doowb