0.1.1 • Published 12 years ago

node-asset-builder v0.1.1

Weekly downloads
4
License
-
Repository
github
Last release
12 years ago

This package depends on GraphicsMagick, need to install first. On Mac: sudo brew install GraphicsMagick or build from here: http://www.graphicsmagick.org/

npm install node-asset-builder

usage:

var NodeAssetBuilder = require("node-asset-builder");

var nab = new NodeAssetBuilder({ imageFolder: '', // default to ./assets cssFolder: '', // default to ./stylus tempFolder: '', // default to ./temp contextName: 'context of the hash', // default to OO cssHashName: 'object Name for storing minified css in the json object', // default to stylus_css imgHashName: 'object name for storing datauri of the images in the json object', // default to asset_list outputPath: 'output path for the js file contains css json and datauri json object', // default to src/autogen cssContainerSelector: 'css selector for the root element. can be a class or object name.', // default to #<%= elementId %> __end_marker: 1 });

nab.genImageDataUriHash(); // output js file contains image datauri hash for each image file. nab.genMinifiedCssHash();

var base64EncodeContent = nab.fileContentToBase64('file to encode to base 64', 'data uri prefix'); // will read a file's content, and convert it to base64. // nab.fileContentToBase64("foo.png", "data:image/png;base64,"), will return the datauri string for png file

// return inline minfied css from a full css string. var minfiedCss = nab.getMinifiedCssString("#foo { width: 5px; } \n #foo, b { color: black; }", "key")

0.1.1

12 years ago

0.1.0

12 years ago

0.0.11

12 years ago

0.0.10

12 years ago

0.0.9

12 years ago

0.0.8

12 years ago

0.0.7

12 years ago

0.0.6

12 years ago

0.0.5

12 years ago

0.0.4

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago