1.0.1 • Published 2 years ago
css-json-conversion v1.0.1
introduction
converts css string to json object and vice versa
installation
npm i css-json-conversion
usage
const { CSSToJSON, JSONToCSS } = require('./index')
console.log(CSSToJSON(` h1
{ font-size:23; color:red;
}
.hello { background-color:'red';}
`))
/// prints {
// h1: { 'font-size': '23', color: 'red' },
// '.hello': { 'background-color': "'red'" }
// }
console.log(JSONToCSS(
{
h1: { 'font-size': '23', color: 'red' },
'.hello': { 'background-color': "'red'" }
}
))
/// prints h1{font-size:23;color:red;}.hello{background-color:'red';}
1.0.1
2 years ago