Javascript module to format string in titlelize