Gathering detailed insights and metrics for get-sass-vars-sync
Gathering detailed insights and metrics for get-sass-vars-sync
npm install get-sass-vars-sync
Typescript
Module System
Min. Node Version
Node Version
NPM Version
45.1
Supply Chain
86.5
Quality
71.1
Maintenance
40
Vulnerability
92.8
License
JavaScript (86.97%)
CSS (13.03%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
6,147
Last Day
1
Last Week
2
Last Month
9
Last Year
183
MIT License
115 Commits
4 Watchers
241 Branches
3 Contributors
Updated on Dec 07, 2016
Minified
Minified + Gzipped
Latest Version
4.0.1
Package Id
get-sass-vars-sync@4.0.1
Size
4.27 kB
NPM Version
5.0.4
Node Version
8.1.0
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
0%
2
Compared to previous week
Last Month
-75.7%
9
Compared to previous month
Last Year
-10.7%
183
Compared to previous year
1
31
Get Sass variables synchronously as JSON object.
1npm install get-sass-vars-sync node-sass --save-dev
The sass-loader requires node-sass
as peerDependency
.
Thus you are able to specify the required versions accurately.
1const fs = require('fs'); 2const sassVarsSync = require('get-sass-vars-sync').default; 3 4sassVarsSync(fs.readFileSync('./index.scss', 'utf-8')) 5 .then(function ( json ) { 6 console.log(json); 7 /* { 8 "$foo": "16px", 9 "$bar": "17.6px", 10 "$baz": 42, 11 "$foo-bar": "#666", 12 "$foo-bar-baz": "#262626", 13 "$foo-bar-baz-bad": "#123", 14 "$grault": [1, 2, "3", "4px", "42%", "1.23457px", [4, 5, 6], {"foo": "bar baz"}], 15 "$garply": {"foo": 1, "bar": [2, 3], "baz": "3 3 3"}, 16 "$qux": false, 17 "$fred": true, 18 "$corgle": null 19 } */ 20 });
index.scss
1$foo: 16px; 2$bar: $foo * 1.1; 3$baz: 42; 4$foo-bar: #666; 5$foo-bar-baz: darken($foo-bar, 25%); 6$foo-bar-baz-bad: #123 !default; 7$grault: 1, 2, "3", 4px, 42%, 1.23456789px, (4,5,6), (foo: "bar baz"); 8$garply: ( 9 foo: 1, 10 bar: (2, 3), 11 baz: "3 3 3" 12); 13$qux: false; 14$fred: true; 15$corgle: null; 16 17.nested { 18 .selector { 19 $nested-var: thud; 20 } 21}
Returns: Object
Gets Sass variables from Sass string.
Only top-level variables will be considered, anything inside selector or at-rule is ignored. PR welcome.
Type: String
Sass input string.
Type: Object
Type: Boolean
Default: false
Camelize first-level JSON object keys and strip inital $
(e.g. $foo-bar
will become fooBar
).
Type: Object
Feel free to push your code if you agree with publishing under the MIT license.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/3 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
89 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-03-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More