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

pagelogic

v1.2.1

Published

HTML-based isomorphic reactive web framework for Node.js and the browser

Downloads

32

Readme

PageLogic

CodeQL Node.js CI

An HTML-based, isomorphic, reactive web framework.

Modern web development is mostly done using some reactive framework, like React, Vue or Angular. This has many advantages, but they all add plenty of complexity and make the experience closer to desktop development.

PageLogic aims to restore simplicity while preserving the benefits of modern frameworks. It extends HTML with <:...> directive tags, :... logic attributes, and ${...} reactive expressions to let you write modular, reactive logic directly in HTML.

Hello world

This is a minimal but complete PageLogic page:

<html>
<body>
  <button :count=${0}
          :on-click=${() => count++}>
    Clicks: ${count}
  </button>
</body>
</html>

We'll save it as index.html in ./www. We can now install PageLogic and serve it like this:

npm i -g pagelogic
pagelogic serve www
# address http://127.0.0.1:3000/

Alternatively we can statically compile with pagelogic build and use the generated HTML pages. Our example will generate a index.html + index.js pair of files which, together, implement page behaviour. The compiler will also generate a pagelogic-rt.js file in the destination directory, containing the PageLogic runtime used by all compiled pages.

Why PageLogic

  • Zero boilerplate — forget all the obscure cerimonies like React's useState() etc.: PageLogic handles these details behind the scenes, keeping your code clean.

  • Zero dependencies — PageLogic pages only need their namesake JavaScript file, implementing page logic, and the PageLogic runtime, both generated by the compiler or the server.

  • No Virtual DOM — PageLogic uses direct DOM reflection, a much lighter and efficient solution.

  • Isomorphic by design — with other frameworks, delivering content-ready pages for search engine indexing can be complex: PageLogic's server does it by default.

  • Super lightweight — because runtime, compiler and server were designed together, it sports a tiny size of less than 3kB (minified, gzipped) in the browser.

  • Flexible deployment — PageLogic pages can be served using its own Node.js server, its Express middleware in the context of your project, or as static precompiled HTML pages.

  • Advanced routing — the same set of pages can work as a classic website and as a modern SPA at the same time.

  • Simple components — moving from a simple block of code to a reusable component is trivial and you can effortlessly build your own reusable libraries over time.