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

@zserge/q

v0.0.2

Published

The worst possible VueJS clone

Downloads

9

Readme

Q!

Build Status npm gzip size

A really small (well under 1KB minified!) library to explain how VueJS-like frameworks work. Never meant to be used in any of the serious projects. But, hey, despite the tiny code size it supports some smart reactivity and comes with a few of the most common directives, isn't it cool? It was really an exercise in minimalism, and nothing more.

If you liked it - there is a similar toy ReactJS library.

Example to whet your appetite

<div id="counter">
	<button q-on:click="clicks++">Click me</button>
	<button q-on:click="clicks=0">Reset</button>
	<p q-text="`Clicked ${clicks} times`"></p>
</div>
<script>
	Q(counter, {click: 0});
</script>

Try "counter" example or try "todo" example.

API Reference

Hey, it might be quicker to read the sources than this text. Anyway, the following directives are supported:

  • q-text - updates element innerText.
  • q-html - updates element innerHTML (use with care).
  • q-if - toggles "hidden" property if the expression is true.
  • q-on:<event> - adds an event listener to the element.
  • q-bind:<attr> - binds element attribute to the expression value.
  • q-model - binds element (normally, <input>) value to the variable.
  • q-each - renders child elements for each item of the array. Child elements have separate scope, with two special variables - $it which is an array element and $parent which is a parent data scope.

To initialize the Q app pass the root element and the data model: Q(el, {name: 'John', age: 42}).

What a weird name for a project

The library is called "Q!". A "cue" means a signal to a performer to begin a speech or action, so it's very much related to the concepts of reactivity/observers/watchers etc. Also, "Q" rhymes with "Vue". Moreover, "Q" resembles zero, which is a metaphor for both, library footprint and usefulness. Finally, there is O! library which is a similar experiment for React and "Q!" seems like a good companion name.

License

Code is distributed under MIT license, feel free to use it in your proprietary projects as well, but I don't advise to do so - better use a proper framework instead.

However, pull requests, issue reports and bug fixes are welcome!