From e280682cddcc93b9f0db5ab72262c127ed94d519 Mon Sep 17 00:00:00 2001 From: Francis Marineau Date: Tue, 12 Aug 2014 17:09:56 -0400 Subject: [PATCH] Added installation, usage and example to readme --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index e7a09bc..e42b7d6 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,22 @@ shrthnd.js ========== Makes your CSS files lighter and more readable by converting and combining properties into their shorthand versions when possible. + +## Installation + + npm install shrthnd + +## Usage + +The module takes a CSS string as only parameter and returns an object containing two properties: + +* **string**: The shorthanded CSS string +* **longPropertiesPositions**: An array containing the position (row & column in input string) of the properties that have been shorthanded + +## Example + + var cssString = 'body { background-image: url(/img/meow.jpg); background-position: top center; }'; + + var shrthnd = require('shrthnd'); + var shorthandedCss = shrthnd(cssString); + console.log(shorthandedCss.string); \ No newline at end of file