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

iizuna

v4.0.0

Published

A TypeScript Framework for non-pwa pages (like content management systems)

Downloads

49

Readme

iizuna Build Status Language grade: JavaScript Total alerts NPM version Donate Tweet

pronunciation: /Īdzuna/

We’re not designing pages, we’re designing systems of components. — Stephen Hay

Iizuna is available for use under the MIT software license.

You can report bugs and discuss features on the GitHub issues page.

To dive into the development you can take a look at the sample page. There you will find some simple example components and a ready to use build process.

Our wiki with the documentation can be found here.

Installation

npm install iizuna --save

Websites using iizuna

  • https://www.babtec.de/en
  • https://corny.de
  • https://www.bemm.de
  • https://www.hogrefe.com/de/

What is iizuna?

Iizuna came from the idea of ​​designing a truly developer-friendly framework. Many of today's TypeScript frameworks, such as Angular or React, are not designed to be used on pages that rely on old-fashioned server-side rendering.

This framework is really easy to use because it basically consists of only one building block, the component.

These components reflect rough HTML elements. Selectors (currently only data-attributes) define which elements are decorated with the business-logic you develop.

Additional attributes allow additional configuration of the components, making them easily reusable.

Wordings

First of all a few explanations to some of the words used in this framework.

Component

The class containing the business logic. Not to be confused with the Individual-Component.

Individual-Component

The objects instantiated based by the Component they are descendants of. For each matching element on the page, which matches the component selector, a Individual-Component is created.

Global Events

CustomEvents which are dispatched directly to the document.

Usage

First, a component must be declared. Here we declare a simple "scroll to top" button.

// scroll-top.component.ts
import {AbstractComponent, Component, ElementAttribute, EventListener, smoothScroll} from "iizuna";

/**
 * Decorate the declared component class with the @Component decorator (the magic happens here)
 */
@Component({
	/**
	 * define the data- selector which should be used to identify the element
	 * (matches scroll-top and data-scroll-top)
	 */
	selector: 'scroll-top'
})
export class ScrollTopComponent extends AbstractComponent {

	/**
	 * Declare a class property and decorate it via the @ElementAttribute decorator which automatically retrieves the attribute value of the element on page load.
	 * (800 if the element would look like this <button scroll-top duration="800">To top!</button>)
	 *
	 * If the attribute is not specified, the default value (in this case 500) is used
	 */
	@ElementAttribute()
	protected duration = 500;

	/**
	 * Attach a simple click listener to the element.
	 *
	 * You can also define multiple listeners of the same kind if you specify the listener name as first argument for the @EventListener decorator like:
	 *
	 * @EventListener('click')
	 * public clickOne() {
	 * }
	 *
	 * @EventListener('click')
	 * public clickTwo() {
	 * }
	 *
	 */
	@EventListener()
	public click() {
		smoothScroll(0, +this.duration);
	}
}

Then we need to register the created component for bootstrapping.

// main.ts
import {ComponentFactory} from "iizuna";
import {ScrollTopComponent} from "./scroll-top.component";

ComponentFactory.registerComponents([
	ScrollTopComponent
]);

Now we just have to define the html and call the page (after building the javascript of cause).

<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
    <title>TypeScript Components</title>
  </head>
<body>
	<button scroll-top duration="1000">To Top 1000ms</button>
  <script src="build.js"></script>
</body>
</html>

Take a look at the examples if you want to see more advanced component configurations.