bluesteel

0.0.13 • Public • Published

BlueSteel.js

bluesteel

BlueSteel.js is a library offering a lot of performance improvements for conventional pages (not singlepage apps). This is done by minimizing the amount of requests, along with smart client side caching, async javascript loading, static content optimization and more.

More indept explanation on how this actually works in in the works

Install

Installation is done though NPM using npm install bluesteel. If you require a view engine, these has to be installed seperatly. Currently the only availible view engine is HBS, which can be installed using npm install hbs

Usage

BlueSteel extends Express.js an is use much like it

var steel = require('steel'),
	app = steel();

app.get('*', function(req, res, next) {
	res.render('home');
});

app.listen(1337);

To use a render engine optimized for BlueSteel, this has to be loaded using app.setViewEngine('hbs');

Resources

BlueSteel comes prepacked with three optimizers, which handles JavaScript, CSS and DIV elements. To use these in Handlebar-views a specific syntax has to be used in the views: {{{res 'type' 'name' steel}}} so if you want to load a css file called default.css the syntax will be {{{res 'style' 'default' steel}}}

To use resource optimization to scripts has to be loaded on every page, which is {{{res 'script' 'cacheload' steel false}}} which has to be loaded as the last line of the head, and {{{res 'script' 'cachesave' steel}}} which has to be loaded as the last line og body.

Example:

<html>
	<head>
		<title>Demo Page</title>
		{{{res 'style' 'bootstrap' steel}}}
		{{{res 'style' 'default' steel}}}
		{{{res 'script' 'cacheload' steel false}}}
	</head>
	<body>
		{{{res 'div' 'menu' steel}}}

		{{{body}}}

		{{{res 'div' 'footer' steel}}}
		{{{res 'script' 'jquery' steel}}}
		{{{res 'script' 'main' steel}}}
		{{{res 'script' 'cachesave' steel}}}
	</body>
</html>

Readme

Keywords

none

Package Sidebar

Install

npm i bluesteel

Weekly Downloads

3

Version

0.0.13

License

ISC

Last publish

Collaborators

  • mortenolsen