Convert object or strings into valid CSS
$ npm install --save object-string-to-css
Online or
const objectStringToCSS = require('object-string-to-css');
objectStringToCSS({
width: 100,
display: "flex",
flexDirection: "column",
}, ".class")
/*
.class{
width: 100px;
display: flex;
flex-direction: column;
}
*/
Throws when
- Invalid JSON
- Invalid Parameter type
Makes migrating my projects faster
If there is any problem with the package, please create an issue on github. Thanks!