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 🙏

© 2025 – Pkg Stats / Ryan Hefner

client-side-renderer

v1.1.3

Published

A simple html renderer for electron or the front end

Downloads

13

Readme

Client side renderer

Client side renderer is a npm package to help you render HTML pages better and easier and was made to supplement Electron but can also be used on the front end

how do I use Client side renderer?

Client side renderer can be used to help or fully render your electron application

intallation

You can install this package into your project using npm

npm install client-side-renderer

Using Client side renderer

to get started create a new javascript file and start with this boilerplate code;

const {RendererConfig , render} = require('client-side-renderer')

// creates a object to repersent the page
const page = new RendererConfig(); 

// creates a property using the type and id props to be appended to the body
page.createElementOnBody("div" , "top"); 

// adds a element to the div property with the id of top
page.createChildOf("div-top" , "h1" , "main-header" , "Hello World"); 

// appends to the h1 stored in index 0 of the child array
page.createChildOf(0 , "h3" , "" , "from client-side-renderer"); 

Elements that have the same tag name and are to be appended onto the body must have a unique id.
children of elements that are appended on the body do not need ids because they are referanced by their index in the children array

you can look at the items in the children array by logging page.children to the console

only the function createChildOf adds to the children array by counting the amount of times this function is called and subtracting 1 you can get the array index for referance

New Features

Newest Features in v1.1.0

Element Editor

The element editor is a class and uses a selector (same as if you were using querySelector or querySelectAll) and can grab one or more elements and make changes to them. With the element editor you can edit the innerHTML Classlist and values.

const {ElementEditor} = require("client-side-renderer")
// true refers if there are mutiply elements you want to select the default is false
const inputGroup = new ElementEditor(true);

// set the selector if you were using query selector you can also set it when you create the object
inputGroup.selector = "form#add input.formInput"

// grabs the elements for you and saves them in the object
inputGroup.getElements();
// edits all elements. the first argument tells what you are value you are changing
// and the second is what the new value to be added is
inputGroup.editAll("innerHTML" , "Hello World");

// edits one element out of the group only works on multiple elements
// you must give it vaild id
inpuGroup.editOne("uniqueId" , "innerHTML" , "from client-side-renderer")

Save and Load

The new pageLoader object allows you to save your pages for referance and access them when the page needs to change.

const {RendererConfig , pageLoader} require("./client-side-renderer");
const page = new RendererConfig();

// create page to render
page.createElementOnBody("h1" , "header" , "Hello world" );
page.createElementOnBody("h3" , "" , "from client-side-renderer");

// instead of renderering the page use pageloader's save method

// homePage is the name of the page and what you uses to retrive the page with the load method
pageLoader.save("homePage" , page);

// when the you want the page to load call the load method on pageloader with the name of the page you gave
pageLoader.load("homePage")

Syntax changes

when attaching a child to a element on the body instead of writing [element , id] you can now write element-id where element is the name of the element and id is the id you gave it. The two values are seperated by a hypen.

if there is no id or id is an empty string just use the element name. element

old

page.createElementOnBody("div" , "top");
page.createChildOf(["div" , "top"] , "h1" , "" , "Old way");

new

page.createElementOnbody("div" , "top");
page.createChidlOf("div-top" , "h1" , "" , "new way")

Future Features

bug fixes