When both Node and Lodash are installed, they can be executed in shell scripts:
CHEESE="Camembert of Goat"
CAMEL_CHEESE=$(node -p -e "require('lodash').camelCase('${CHEESE}')")
KEBAB_CHEESE=$(node -p -e "require('lodash').kebabCase('${CHEESE}')")
echo $CAMEL_CHEESE # camembertOfGoat
echo $KEBAB_CHEESE # camembert-of-goat
Continue reading “Lodash in Shell”