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

estrad

v0.1.7

Published

A tool to create modular static frontend templates with a mocked backend

Downloads

5

Readme

Estrad

Estrad is a collection of Gulp tasks, and a tool to make building modular HTML/CSS/JS websites easier.

The goal is to have a build process fast enough that you do not have to wait whenever a file is saved. Because of the possible complexity of HTML templates Estrad will not compile them on file save. Instead a server is included that compiles HTML pages on request.

Install

Estrad requires node.js and Gulp, install them if you have not already.

Install gulp:

$ npm install gulp -g

To install Estrad in your project run:

$ npm install estrad --save-dev

Include Estrad in your Gulpfile.js and pass it gulp:

var
	gulp = require('gulp'),
	estrad = require('estrad')(gulp, options);

gulp.task('default', ['estrad']);

Options

Estrad includes a lot of tasks, all are disabled by default. The default options are:

{
	"dir": {
		"src": "/",
		"partials": "/",
		"build": "/"
	},
	
	"css": {
		"watch":        false,
		"build":        false,
		"preprocessor": false,
		"settings":     {},
		"minify":       false,
		"paths": {
			"listen": [
				
			],
			"src": [
				"!./node_modules/"
			],
			"dest": ""
		}
	},

	"html": {
		"build": false,
		"prettify": {
			"indent_size": 1,
			"indent_char": "\t",
			"preserve_newlines": false
		},
		"paths": {
			"src": [
				"!./node_modules"
			],
			"dest": ""
		}
	},

	"images": {
		"watch": false,
		"build": false,
		"svgToPng": false,
		"paths": {
			"listen": [

			],
			"dest": ""
		}
	},

	"js": {
		"watch": false,
		"build": false,
		"uglify": {},
		"paths": {
			"require": "",
			"listen": [
				
			],
			"src":  [
				"!./node_modules"
			],
			"dest": ""
		}
	},

	"server": {
		"start": false,
		"proxy": false,
		"port":  8080,
		"templateSettings": {}
	},

	"static": {
		"build": false,
		"paths": {
			"src": [
				"!./node_modules"
			],
			"dest": ""
		}
	}
}

dir

src

Directory of source files.

partials

Directory of html partials.

build

Directory to output the built project to.

css

preprocessor

Can be:

false for no preprocessor.

"sass" to use SASS with Compass. Requires that you add config.rb.

"stylus" to use Stylus with Nib.

settings

Stylus settings object. Values here will be passed to gulp-stylus.

Example:

{
	"compress": true,
	"linenos": true,
	"url": "url"
}

The url option will base64 images and inline them in the css file.

images

Smushes svg, png, jpg and gif files. Will also create a png from any svg.

js

watch

At the moment all this does is lint your files with JSHint. Estrad comes with a basic setup of rules. To change the ruleset add a .jshintrc file.

build

Require.js optimization tool r.js.

server

template

templateSettings

doT.templateSettings

Set these to avoid running your client templates on the server.

Watching files

$ gulp estrad

Build files

To build the project files type:

$ gulp estrad-build

This will build any css, js and html files.

The idea is that this process will compile a "deliverable" of all front end code. This is a goal for the future.

Write a module

First you need a page, see index.html for an example. It looks like this:

{=part.header}
{=part.example}
{=part.footer}

The structure of a module can look like this:

/example/example.html
/example/example.json
/example/alternative.json	
/example/example.css
/example/example.js

To use the alternative.json file include the module as {=part.example.alternative}.

To create header and footer modules, add the files /modules/header/header.html and /modules/footer/footer.html.

doT

Estrad uses doT to for including mock data. Use the it namespace to access properties set in the json files. The mock data is self-contained and will only affect that module.

Reverse proxy

Estrad includes a reverse proxy. To set up a path add it to routes.json. This can be a local resourse or cross domain.

Get queries can be overridden in routes.json.