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

@re4ma/re4ma

v0.1.7

Published

Simple in-browser HTML page generator

Downloads

9

Readme

Re4ma - magic in-browser HTML-page generator

Implements very simple but powerful module system for HTML documents building

Import types:

  • HTML (*.html, *.htm): modules, chunks, templates whith a data placeholders and <slot> based composition support
  • Markdown (*.md)
  • Code snippets with a syntax highlight
  • JavaScript (as imported module dependency)
  • CSS (external files connection + inline)
  • Images and image processing
  • Custom contents import and processing
  • JSON-data applied to HTML template
  • etc...

Symbiote.js friendly

Use Symbiote-components for any dynamic page content.

https://symbiotejs.org/

Usage:

Connect re4ma script from CDN:

<script
  src="https://unpkg.com/@re4ma/re4ma@latest/build/re4ma.js">
</script>

NPM installation:

npm i @re4ma/re4ma

Then you can use these simple HTML-tags:

<!-- Import any external HTML chunk or component: -->
<re-htm src="htm/page.htm"><re-htm>

<!-- Import and render Markdown: -->
<re-md src="md/article.md"><re-md>

<!-- Import and render code snippet: -->
<re-code src="js/snippet.js"><re-code>

<!-- Import Javascript on demand: -->
<re-js src="js/app.js"><re-js>

<!-- Import styles: -->
<re-css src="css/styles.css"><re-css>

<!-- Import with custom source handler: -->
<re-load
  loader="scripts/txt-loader.js"
  src="some_content.txt">
<re-load>

<!-- Image: -->
<re-img 
  loader="scripts/my-loader.js"
  src="img/picture.jpg">
<re-img>

<!-- Rendering from external data endpoint: -->
<re-peat 
  template-src="htm/user-card-template.htm"
  data-src="data/users.json">
<re-peat>

HTML-file extension convention:

Use *.html file names for HTML-pages and *.htm for chunks and modules

Named Slots:

<re-htm src="html/page.htm">
  <div slot="content"></div>
<re-htm>

In HTML Chunk:

<div>
  <slot name="content"></slot>
</div>

Placeholders for arttribute values:

Set custom HTML attributes:

<re-htm src="html/page.htm" --text="My Text"><re-htm>

Then use values in template:

<div>{{text}}</div>

Build stage helper attributes

Clear element content (remove children):

<my-component re-clear><my-component>

Remove cetrain element after render:

<my-component re-move><my-component>