0.3.0 • Published 2 years ago

eleventy-filter-npm-package-downloads v0.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
2 years ago

eleventy-filter-npm-package-downloads

CircleCI status Known Vulnerabilities codecov Greenkeeper badge Maintainability

Filter for 11ty to show the number of downloads of a npm package. Based on the work of @alex-page!

Installation

That's easy!

npm install eleventy-filter-npm-package-downloads

Usage

Add it to your .eleventy.js like so:

const npmPackageDownloads = require('eleventy-filter-npm-package-downloads');

module.exports = function (eleventyConfig) {
  eleventyConfig.addNunjucksAsyncFilter('packageDownloads', async (packageName, callback) => {
    await npmPackageDownloads(packageName, callback);
  });

  return {
    templateFormats: [
      'html',
      'md',
      'njk'
    ]
  };
};

Now you can use it in your layout templates:

You've got {{ '@11ty/eleventy' | packageDownloads }} downloads this week!

License

MIT. See LICENSE

0.3.0

2 years ago

0.2.0

2 years ago

0.1.4

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago