0.4.0 • Published 7 months ago

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

Weekly downloads
2
License
MIT
Repository
github
Last release
7 months ago

eleventy-filter-npm-package-downloads

Known Vulnerabilities

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.config.js like so:

import { npmPackageDownloads } from 'eleventy-filter-npm-package-downloads';

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

  return {
    markdownTemplateEngine: "njk"
  };
};

Now you can use it in your layout templates:

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

License

MIT. See LICENSE

0.4.0

7 months ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.4

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago