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

nwl-components

v1.3.11

Published

This project is a library of components to be used on the frontend of the Neuroweblab projects. They are similar in style and behaviour to existing projects.

Downloads

175

Readme

About

This project is a library of components to be used on the frontend of the Neuroweblab projects. They are similar in style and behaviour to existing projects.

Single File Components

This project makes use of Vue SFCs: Single File Components, that have the .vue extension. They encapsulate the template, logic, and styling of a component in a single file, which makes sense for a library of components. Read more about SFC in the Vue documentation.

Scoped styles

When a tag has the scoped attribute, its CSS will apply to elements of the current component only. This is similar to the style encapsulation found in Shadow DOM.

Read more on https://vuejs.org/api/sfc-css-features.html#scoped-css

The idea here is to encapsulate the appearance of components in the file they are defined, and not let in leak elsewhere.

Composition API

The components make use of the Vue 3 Composition API which make code more reusable and to make it code more compact.

See below how we use composables to define access to the store methods and properties.

Store

In the project, the store is comprised of the modules in src/store.

Said modules are composables that consist of a main function, usually prefixed with use, designed to expose stateful logic to other components.

They contain reactive objects and actions to update them that you can "inject" inside of other components.

The idea is to have a centralized way of performing CRUD updates on the stateful slices of data on which rely other components.

Pure components

Pure components, also sometimes called dumb components, doesn't have any logic tied to them: they're just taking care of how the component look and behave according to props. They can emit events, but the listeners should be plugged in the parent components.

The parent components are said to be container components (or sometimes smart components) : this is where you actually define the logic and actions of updating the store or retrieving data from it. They're the one actually connected to the store, defined above.

This concept makes it possible to separate view and business logic. In the project, pure components are prefixed with Pure.

Storybook

The components are documented through storybook, where you can see their props and see example use cases (for now we just have 'default' ones). Storybook stories are defined in files with the .stories.js extension. It's a quite handy tool to develop a component in isolation of other components.

Run npm run storybook to launch storybook.

To have a documentation always accessible, it could be possible to build storybook and publish it on Chromatic, for example through this Github Action.

Recommended IDE Setup