Gathering detailed insights and metrics for node-sass-functions-json
Gathering detailed insights and metrics for node-sass-functions-json
Gathering detailed insights and metrics for node-sass-functions-json
Gathering detailed insights and metrics for node-sass-functions-json
node-sass-json-functions
JSON encode and decode functions for node-sass.
node-sass-json-vars
Custom sass functions that allow using variables from JSON files.
@emiplegiaqmnpm/mollitia-rem-nihil
A [Dart][dart] implementation of [Sass][@emiplegiaqmnpm/mollitia-rem-nihil]. **Sass makes CSS fun**.
npm install node-sass-functions-json
Typescript
Module System
Node Version
NPM Version
JavaScript (63.93%)
CSS (36.07%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
3 Stars
83 Commits
1 Forks
4 Watchers
177 Branches
3 Contributors
Updated on Mar 02, 2019
Latest Version
1.0.0
Package Id
node-sass-functions-json@1.0.0
Size
5.25 kB
NPM Version
4.2.0
Node Version
7.10.0
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
1
28
JSON encode and decode functions for node-sass.
1npm install node-sass-functions-json --save
1const sass = require('node-sass'); 2const jsonFunctions = require('node-sass-functions-json'); 3 4sass.render({ 5 file: './index.scss', 6 functions: Object.assign({}, jsonFunctions) 7}, function (error, result) { 8 // ... 9});
Module exports object with prepared functions json-encode
and json-decode
.
If you need functions as separate entities, they are available as static properties encode
and decode
.
Input:
1$list: 1, 2, "3", (4,5,6), (foo: "bar baz"); 2$map: ( 3 foo: 1, 4 bar: (2, 3), 5 baz: "3 3 3", 6 bad: ( 7 foo: 11, 8 bar: 22, 9 baz: ( 10 5, 4, 6, null, 1, 1.23456789px 11 ), 12 bag: "foo bar" 13 ), 14 qux: rgba(255,255,255,0.5), 15 corgle: red 16); 17 18body { 19 content: json-encode($list); 20 content: json-encode($map); 21 content: json-encode($list, $quotes: false); 22 content: json-encode($map, $quotes: false); 23}
Output:
1body { 2 content: '[1,2,"3",[4,5,6],{"foo":"bar baz"}]'; 3 content: '{"foo":1,"bar":[2,3],"baz":"3 3 3","bad":{"foo":11,"bar":22,"baz":[5,4,6,null,1,"1.23457px"],"bag":"foo bar"},"qux":"rgba(255,255,255,0.5)","corgle":"#f00"}'; 4 content: [1,2,"3",[4,5,6],{"foo":"bar baz"}]; 5 content: {"foo":1,"bar":[2,3],"baz":"3 3 3","bad":{"foo":11,"bar":22,"baz":[5,4,6,null,1,"1.23457px"],"bag":"foo bar"},"qux":"rgba(255,255,255,0.5)","corgle":"#f00"}; 6}
Input:
1$array: '[1,2,"3",[4,5,6],{"foo":"bar baz"}]'; 2$object: '{"foo":1,"bar":[2,3],"baz":"3 3 3","bad":{"foo":11,"bar":22,"baz":[5,4,6,null,1,"1.23456789px"],"bag":"foo bar"},"qux":"rgba(255,255,255,0.5)","corgle":"#f00"}'; 3 4@debug json-decode($array); 5@debug json-decode($object);
Output:
1DEBUG: 1, 2, 3, 4, 5, 6, (foo: bar baz) 2DEBUG: (foo: 1, bar: 2, 3, baz: 3 3 3, bad: (foo: 11, bar: 22, baz: 5, 4, 6, null, 1, 1.23456789px, bag: foo bar), 3 qux: rgba(255, 255, 255, 0.5), corgle: red)
Returns: sass.types.String
Encodes (JSON.stringify
) data
and returns Sass string.
By default, string is quoted with single quotes so that it can be easily used in standard CSS values.
Sass lists are transformed to arrays.
Sass maps are transformed to objects.
Sass colors are transformed
to rgba()
syntax if they have alpha value, otherwise they are transformed
to hex value (and it’s shorther version if possible).
Sass strings are transformed to strings
Sass numbers are transformed to numbers.
Sass null values and anything unresolved is transformed to null values.
Type: sass.types.*
Data to encode (stringify).
Type: Boolean|sass.types.Boolean
Default: true
Should output string be quoted with single quotes.
Returns: sass.types.*
Decodes (JSON.parse
) string
and returns one of available Sass types.
Arrays are transformed to Sass lists.
Objects are transformed to Sass maps.
Anything properly parsed with parse-color is transformed to Sass color.
Strings are transformed to Sass numbers with units if they can be properly parsed with parse-css-dimension, otherwise they are transformed to Sass strings.
Numbers are transformed to Sass numbers.
Null values and anything unresolved is transformed to Sass null values.
Type: sass.types.String|sass.types.Number|sass.types.Boolean|sass.types.Null
String to decode (parse).
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/6 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
83 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
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