CSS in JS via the CSSStylesheet API
This library takes a CSS string and outputs an Array of Strings that are consumable by the CSSStylesheet API
npm install --save cssrulesconstcssrules=require('cssrules');cssrules(`.myrule { color: red; }`).then(output=>{console.log(output);});constcssrules=require('cssrules');constfs=require('fs');constpath=require('path');constmyCssFile=fs.readFileSync(path.resolve('./my_file.css','utf8'));cssrules(myCssFile).then(output=>{console.log(output);});- webpack via cssrules-loader