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

hubl

v0.0.21

Published

Implementation of HubL using Nunjucks

Downloads

3

Readme

IMPORTANT: this is a WIP

hubl

Implementation of HubL using Nunjucks

It's important to note that a fair few of the HUBL tags pull data from the Hubspot CRM/CMS. These methods have been implemented as stubs.

See src/test.js for example.

Why?

I want to be able to test my modules and templates using Jest.

How to use

You'll need to decide if you're running this in the context of node or browser. If you're using Storybook it'll likely run in-browser. However, if you're using webpack it'll run on node (this impacts how included templates are discovered/included)

  1. npm install hubl
  2. decide how you want to populate test data using the manager instances.

If you want to render a whole page template, these require a fair bit more bootstrapping.

const pageManager = new PageManager([pages go here]);
const hubdbManager = new HubDBManager({ hubdb tables})
const menuManager = new HubDBManager([ menus ])

// singleton version
configure(pageManager, hubdbManager, menuManager, ctaManager);

const hublTemplateCode = '{{ something | count }}';
renderPageString('/', hublTemplateCode, { ... variables ... })

Modules on the other hand, you can just ignore all the configure stuff as long as you don't use any methods like menu()

renderModuleString('{{ module.variable }}, { variable: 1 });
{{ theme.* }} is set on all.

todo:

  1. support hubl in scss
  2. integrate all key filters
  3. integrate all functions
  4. integrate all tags
  5. allow hooks for any methods which use data from hubspot - allowing data to be populated from the API (build a static version of the site), nots sure this is possible yet though.
  6. support space seperated params for filters - currently you need to use commas.