Organize code

This commit is contained in:
Rafael Caricio 2014-09-06 19:46:07 +02:00
parent 670d58c505
commit f9a6a179d1
4 changed files with 30 additions and 3 deletions

View file

@ -1,4 +1,4 @@
# gradient-parser
# Gradient Parser
## About
@ -9,7 +9,33 @@ Parse CSS3 gradient definition and returns AST.
### JavaScript
```JavaScript
// TODO
var gradient = require('gradient-parser');
var obj = gradient.parse('linear-gradient(30deg, #000, transparent)');
console.log(JSON.stringify(obj, null, 2));
```
Results in:
```JSON
[
{
"type": "linear-gradient",
"orientation": {
"type": "angular",
"value": "30"
},
"colorStops": [
{
"type": "hex",
"value": "000"
},
{
"type": "literal",
"value": "transparent"
}
]
}
]
```
## Install Choices

1
index.js Normal file
View file

@ -0,0 +1 @@
exports.parse = require('./lib/parser');

View file

@ -23,7 +23,7 @@
"type": "git",
"url": "git://github.com/rafaelcaricio/gradient-parser.git"
},
"main": "gradient-parser.js",
"main": "index.js",
"scripts": {
"test": "grunt"
},