Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
dss-parser-variable
Advanced tools
A @variable
parser for documenting SCSS/LESS variables from Documented Style Sheets (DSS).
In a file test.scss
:
/**
* @name Colours
* @variable white
* @variable blue - Sky blue
* @variable dark-red Button outlines
*/
$blue: #0000FF;
$dark-red: #FF0000;
$black: #000000;
In JavaScript:
var fs = require('fs'),
dss = require('dss'),
variableParser = require('dss-parser-variable');
dss.parser('variable', variableParser());
var scss = fs.readFileSync('test.scss'),
options = {},
callback = function(parsed){
console.log(JSON.stringify(parsed, true, 4));
};
dss.parse(scss, options, callback);
Will output:
{
"blocks": [{
"name": "Colours",
"variable": [
{ "name": "blue", "description": "Sky blue", "value": "#0000FF" },
{ "name": "dark-red", "description": "Button outlines", "value": "#FF0000" }
]
}]
}
Note there is no entry for white
because the variable does not exist in the file, and there is no entry for black
because there is no description in the DSS block.
If you pass false
flag to the constructor it will include variables that does not exist in the file, i.e. there would be entry for a white
in output.
FAQs
A variable parser for DSS (Documented Stylesheets)
The npm package dss-parser-variable receives a total of 0 weekly downloads. As such, dss-parser-variable popularity was classified as not popular.
We found that dss-parser-variable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.