npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@visual-framework/vf-extensions

v2.1.2

Published

Reusable componentised code, modules and config for vf-eleventy based projects.

Downloads

1,629

Readme

vf-extensions

This project supports sites using Visual Framework components, like vf-eleventy It has reusable componentised code, Gulp tasks, modules and config.

What's here and what it does

Gulp tasks

in ./gulp-tasks/

  • gulp-build-search-index.js: scans compiled html to make a JS object search index
    • requires yarn add strip-js striptags node-html-parser
    • Elements wrapped with class="vf-search-client-side--no-index" will not be logged in the index
  • _gulp_rollup.js: require this bundle and get the files below
    • gulp-eleventy.js: specific to running Eleventy
    • gulp-fractal.js: specific to running Fractal
    • gulp-util.js: utility tasks

Eleventy

in /11ty

  • eleventy-cmd.js: a fork of the default Eleventy cmd.js
  • index.js: reusable extensions/config for Eleventy and to load the below tags and filters
    • vfEleventyCommonPlugin.js: Reusable config for sane defaults

Nunjucks tags

in ./tags/

  • codeblock.js: outputs highlight code markup
  • markdwon_tag.js: process a text area as markdown
  • render.js: port-fork-enhancement of the Fractal render extension for Nunjucks for 11ty and the VF
    • {% render '@'+variant.handle, variant.context, true, { escape: false, beautify: true, codetype: 'html', highlight: true } %}
    • second property is for merging the parent context to set defaults
    • third option set escaping of code, beautify (formatting), code type (default: html) and highlighting (hljs)
  • spaceless.js: trim unneeded whitespace

Nunjucks filters

in ./filters/

  • markdown.js: process a string as markdown
  • section.js: split the content into excerpt and remainder
  • path.js: catch references to the "path" filter which is not part of 11ty and results in obtuse error codes

Assorted utilities

In ./utils/

  • minify-html.js: pass in html content and minify

Usage with Eleventy

Note: Projects utilising vf-eleventy make use of this package by default.

  1. a project based off vf-eleventy

  2. yarn add @visual-framework/vf-extensions

  3. in eleventy.js you should have:

  const vfEleventyExtension = require("@visual-framework/vf-extensions\/11ty");
config.addPlugin(vfEleventyExtension);
  1. in gulpfile.js you should have:
require('./node_modules/\@visual-framework/vf-extensions/gulp-tasks/_gulp_rollup.js')(gulp, path, componentPath, componentDirectories, buildDestionation);