SASS-COLOR-JSON
Convert any SASS file with color variables to a json file.
We currently support: hex colors (3 or 6 character), rgb, hsl, rgba & hsla.
Module can be used as CLI or within your node project.
As of version 0.2.0 We now have a Synchronous (0.1.0) and Asynchronous version. The CLI still relies on the synchronous version. No other options have changed. The script overall was made shorter and faster.
Options (as json object {})
input
Required: True
Type: String
Default: " "
output
Required: False
Type: String
Default: False
When not supplied: Returns JSON object
isString
Require: False
Type: Boolean
Default: False
Example
SASS / SCSS
//Example SASS -> JSON
Terminal:
$ sass-color-json --input ~/_colors.scss --output ~/colors.json
Node Module
/** * BLOCKING SYNC VERSION**/var sassColorJson = sassColorOptions = input: '_colors.scss' jsonObj = sassColorJson; console; /** * NON-BLOCKING ASYNC VERSION * Async keeps all the same functionality as previous versions, but is non-blocking.**/sassColorJson; /** * Processing Strings**/var buffer = fs;
Output:
CLI Shortcuts
input: -i, --file, -f
output: -o
Notes
If no output is suppled the module returns JSON Object.
If output is only a directory module assumes filename sass-variables.json