less-vars-to-json2

A plugin for convert less vars to json.

Usage no npm install needed!

<script type="module">
  import lessVarsToJson2 from 'https://cdn.skypack.dev/less-vars-to-json2';
</script>

README

less-vars-to-json

A plugin for convert less vars to json.

usage

function lessVars2Json(content: string, options?: Options): Record<string, string>;

example

const { lessVars2Json } = require('less-vars-to-json');

const content = '@primary-color: #ffffff;\n @color: #000000';

const vars = lessVars2Json(content);

console.log(vars); // { '@primary-color': '#ffffff', 'color': '#000000' }

options

strip (boolean): Whether to remove the prefix. (default false)

debug (boolean): Whether open debug mode. (default false)

format('camelCase' | 'kebabCase' | 'none'): Format key of variables. (default 'none')

license

MIT