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

webpublisher

v0.0.1

Published

Node module for upcoming Webpublisher service.

Downloads

6

Readme

Webpublisher

** Coming Soon! **

Webpublisher is a node module that will work along side of Express that aims to remove the need for website creation all together.

This allows you to focus your business and technology, and dynamically update website when new features are added in real time.

Form creation & handling in one spot

No need to connect the dots. All user interaction is both created, and handles in one spot. This simplifies your business logic and makes refactoring a snap!

//names will automatically be formatted,
//email and password will be proper field types
content.form(['firstName', 'lastName', 'email', 'password'], signup);

function signup(data) {
	//save data in database
}

Live Updating

Every time you make a change and save, the website will refresh immediately with it’s new content. This makes rapid content creation easier.

//push content
publicSite.page('/', require('./public/home'));
publicSite.page('/signup', require('./public/signup'));
webpublisher->publish();

We recommend running Nodemon to make updating-on-save easier.

Dynamically added content

Want to do some A/B Testing? Or show different content to different people? Create a callback to load dynamic content on specific parts of your website.

content->title('Lets load some on-demand content!');
content->dynamic(function(content){
	if(Math.round(Math.random()))
  	content->title({title: 'Option #1', size: 3});
	else
  	content->title({title: 'Option #2', size: 3});
});
content->paragraph('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.');

Live-Updating Variables

All your variables (global, user specific or privilege based) will update in real time for everyone viewing your website when you make a change.

content->paragraph(‘Hello {user.name}!’);

//set a user-specific variable called name
webpublisher->var('user', 'name', 'Greg');

Themes

Create your themes with 5 variables, and attach those themes to any element you are creating (child elements will automatically inherit).

Theme Variables:

  • Background
  • Text
  • Link
  • Active
  • Border

User Access Levels

Control access to your website and pages easily by creating user access levels. Each privilege will also have its own set of variables.

//on top of public
webpublisher->privileges('admin', 'accounting', 'employee');

webpublisher.page('/admin', require('./admin/dashboard'), ['admin']);

function handleLogin(data){
	//verify user

	//promote user
	user->promote(‘admin’)
	user->redirect('/admin');

	//set an admin-level variable
	webpublisher->var('admin', 'logins', webpublisher->var('admin', 'logins') + 1);
}

Simple or Verbose

Whenever possible, we provide a much simpler syntax for getting 90% of the jobs done. We also document a verbose method for extra customization.

//simple:

content.form(['firstName', 'lastName', 'email', 'password'], handleSignup);

//Does the exact same thing as:

var formData = {
	type: 'horizontal'
	field: {
		firstName: {
			type: 'text',
			placeholder: '',
			title: 'First Name',
			required: true,
			hint: ''
		},
		lastName: {
			type: 'text',
			placeholder: '',
			title: 'Last Name',
			required: true,
			hint: ''
		},
		email: {
			type: 'email',
			placeholder: '',
			title: 'Email',
			required: true,
			hint: ''
		},
		password: {
			type: 'password',
			placeholder: '',
			title: 'Password',
			required: true,
			min: 7,
			hint: ''
		}
	}
};

content->form(formData, handleSignup);