Simple module, and simple readme.
Signature is as follows
/**
* @param {string} baseName
* @param {Object<string, boolean>} extras
* @return {string}
*/
className(baseName, extras = {});
Example usage
const classNames = require('html-classnames');
const isBig = true;
const isLong = false;
const names = classNames('some-class', {
'--is-big': isBig,
'--is-long': isLong,
});
console.log(names); // "some-class some-class--is-big"
npm install html-classnames
or
yarn add html-classnames
This repository is using semantic-release, so you can find nice changeglog in the CHANGELOG file.
All contributions welcome. Feel free to start new issue or even create a PR right away!