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

slabjs

v0.2.3

Published

A front-end framework for compiling static pages with PageSpeed optimization.

Downloads

10

Readme

SlabJS

SlabJS is a web framework that allows you to build dynamic web applications and compile them into standalone, optimized, static HTML.

Features

The following features are included with this version:

  • jQuery
  • Modernizr
  • Bootstrap 3.3
  • Handlebars (other template engines to come at a later date)
  • Template Data for Handlebars
  • libSass
  • Compass Mixins (via libSass)
  • Font Awesome 4.3
  • SVG Icon Font generation
  • Browserify (with map generation)
  • BrowserSync
  • Google Analytics Injection
  • Google Fonts Injection
  • Optimal PageSpeed scores!

Table of Contents

Installation

Making Your Project

Project Configuration

Generators

Coming in Next Releases

Installation

With node installed:

# Get the latest stable release of SlabJS
$ npm install slabjs -g

Make Your Project

Create the app:

# Create your app
$ slab create app

Launch the app and get working:

# cd into your new app
$ cd app

# launch the server
$ slab launch

Compile for production

By passing production into the environment option, you will be making the following optimizations:

  • Minify CSS
  • Minify JS
  • Generate gzip for your JS files (it's up to you how you enable them)
# launch the server with production code
$ slab launch --env production

Project Configuration

You can add project specific information to inject into your HTML by adding it to a file at ./config/project.js

Inject Google Font stylesheets into your head

# ./config/project.js

# copy the value directly after the family parameter 
# provided by the Google Fonts link tag:
# <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
google_fonts: {
	families: [
		'Open+Sans',
		'Lobster',
		'Raleway:400,200,700'
	]
},

Inject Google Analytics scripts to your footer

# ./config/project.js

# you can add multiple scripts. Keep in mind only one 
# legacy script can be added(ga.js)
google_analytics: {
	ua_codes: [
		{
			type: 'universal', //universal or legacy
			ua_code: 'UA-XXXXXXXX-X'
		},
		{
			type: 'universal',
			ua_code: 'UA-YYYYYYYY-Y'
		},
		{
			type: 'legacy',
			ua_code: 'UA-ZZZZZZZZ-Z'
		}
	]

}

Template Data for Handlebars

# ./config/project.js
template_data: {
	title: 'Example title'	
}
# ./src/views/partials/head.hbs
<title>{{title}}</title>
# ./build/index.html
<title>Example title</title>

Generators

Sometimes, live updating will not always work for you. This is where generators come in.

Regenerate your SVG font.

# Make more font characters
$ slab generate icons

Fetch the latest Font Awesome library

# Get the latest Font Awesome
$ slab generate fontawesome

More to come...

Coming Soon

  • Bower & Bower support for Browserify
  • Handlebars Layouts
  • Controllers for your views (to replace Tempalate Data)
  • GIT Deployments

Known Issues

  • There is a minor issue on first launch where the virtual server doens't catch up with the generated files. A small refresh seems to fix it. This will be fixed in the next release.