alexrqs / lz-cli

Scaffold tool for the lazy boy inside the devs
MIT License
1 stars 0 forks source link

I want to capitalize when parse prompt variable #1

Open sebastianramirez-natgeo opened 6 years ago

sebastianramirez-natgeo commented 6 years ago

I have the follow scenario

import <%= (moduleName)[0].toUpperCase() + (moduleName).slice(1) %> from '../src/<%= moduleName %>'

However i want to keep it simple just using capitalize instead all stuff there

import <%= (moduleName).capitalize() %> from '../src/<%= moduleName %>'

Thanks

alexrqs commented 6 years ago

@sebastianramirez-natgeo you can capitalize the variables on lz with the lodash capitalize method that is included.

<%= _(foo).capitalize() %>

also you can apply inflection thanks to https://www.npmjs.com/package/lodash-inflection (included)

<%= _(foo).pluralize() %>

even mixed

<%= _(moduleName).pluralize().capitalize() %>

Or any other lodash method like:

sebastianramirez-natgeo commented 6 years ago

cool!, i'll take a look into it