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 🙏

© 2025 – Pkg Stats / Ryan Hefner

pugin-components

v0.9.9

Published

A shunter npm package containing dust components for beta.parliament.uk

Downloads

13

Readme

Pugin Components

Pugin Components is a front-end dust component library for beta.parliament.uk. It is built on Shunter.

Build Status Test Coverage License

Contents

Requirements

Pugin Components requires the following:

Quick start

git clone https://github.com/ukparliament/pugin-components.git
cd pugin-components
npm install
npm cache clean --force && npm test

Running the application

To run the application locally, run:

make develop

This runs foreman that starts the app and shunter erve

The application should now be available at http://localhost:5500.

Using the Library

To use the package, you need to add it and save it into the list of dependencies in your package.json file:

npm install --save pugin-components

Then go to your shunter application's config (for example app.js or index.js). Add modules to the file, like the example below:

const app = shunter({
    path: {
        themes: __dirname
    },
    routes: config.routes,
    jsonViewParameter: 'json',
    modules: ['pugin-components']
});

You should now be able to call on the components as if they were in a view folder in your root directory.

Updating versions of Pugin assets (CSS/JS)

The make build task compiles the css and javascript assets from Pugin. This task is used when you would like to specify a different tag release of Pugin as to what was originally installed.

For example, in the package.json amend parliamentuk-pugin to another tag release:

"parliamentuk-pugin": "git+https://github.com/ukparliament/parliament.uk-pugin.git#1.11.3",

then run:

"make build"

After which you then run npm update in your local application.

Running tests on single files or directories

The npm run testfocus command will let you specify a directory or file of tests to be run.

For example, to run one test:

npm run testfocus test/unit/components/card/generic.spec.js

Or to run a directory of tests:

npm run testfocus test/unit/components/card/

i18next Note

Passing in data to the translation with double moustaches sanitises input. If you wish to pass in a URL or other data that you do not wish to be sanitised, for it be rendered correctly you must prefix the variable name with a hyphen. For example:

Double moustaches

The following translation:

"cookie-policy": "<a href='{{link}}'>Cookie Policy</a>"

Will be rendered incorrectly as:

<a href='*&meta*&cookie'>Cookie Policy</a>

Prefixing the variable name with a hyphen

The following translation:

"cookie-policy": "<a href='{{-link}}'>Cookie Policy</a>"

Will be rendered correctly as:

<a href='/meta/cookie'>Cookie Policy</a>

Contributing

If you wish to submit a bug fix or feature, you can create a pull request and it will be merged pending a code review.

  1. Fork the repository
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Ensure your changes are tested using Mocha
  6. Create a new Pull Request

License

Pugin Components is licensed under the MIT.