Gathering detailed insights and metrics for get-sass-vars
Gathering detailed insights and metrics for get-sass-vars
Gathering detailed insights and metrics for get-sass-vars
Gathering detailed insights and metrics for get-sass-vars
npm install get-sass-vars
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
19 Stars
54 Commits
4 Forks
1 Watchers
1 Branches
3 Contributors
Updated on Mar 31, 2025
Latest Version
4.0.3
Package Id
get-sass-vars@4.0.3
Unpacked Size
55.96 kB
Size
8.34 kB
File Count
17
NPM Version
6.14.16
Node Version
12.22.12
Published on
Nov 30, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
8
Get Sass variables as JSON object.
1npm install get-sass-vars --save
1import { promises as fs } from 'fs'; 2import sassVars from 'get-sass-vars'; 3 4(async () => { 5 const css = await fs.readFile('./index.scss', 'utf-8'); 6 const json = await sassVars(css); 7 console.log(json); 8 /* { 9 "$foo": "16px", 10 "$bar": "17.6px", 11 "$baz": 42, 12 "$foo-bar": "#666", 13 "$foo-bar-baz": "#262626", 14 "$foo-bar-baz-bad": "#123", 15 "$grault": [1, 2, "3", "4px", "42%", "1.23457px", [4, 5, 6], {"foo": "bar baz"}], 16 "$garply": {"foo": 1, "bar": [2, 3], "baz": "3 3 3"}, 17 "$qux": false, 18 "$fred": true, 19 "$corgle": null 20 } */ 21})();
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), ( 8 foo: 'bar baz' 9 ); 10$garply: ( 11 foo: 1, 12 bar: ( 13 2, 14 3 15 ), 16 baz: '3 3 3' 17); 18$qux: false; 19$fred: true; 20$corgle: null; 21 22.nested { 23 .selector { 24 $nested-var: thud; 25 } 26}
Returns: Promise<JsonObject>
Gets Sass variables from Sass string.
Only top-level variables will be considered, anything inside selector or at-rule is ignored.
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: sass.Options<"async">
Default: {}
Returns: JsonObject
Gets Sass variables from Sass string. Sync version.
All arguments are same as async version, except options.sassOptions
which is
of type sass.Options<"sync">
.
MIT © Ivan Nikolić
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 1/29 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
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
Score
Last Scanned on 2025-07-07
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