Skip to content

Instantly share code, notes, and snippets.

@nidhhoggr
Created November 27, 2013 01:55
Show Gist options
  • Save nidhhoggr/7669511 to your computer and use it in GitHub Desktop.
Save nidhhoggr/7669511 to your computer and use it in GitHub Desktop.
underscore titleize humanize
var _ = require('underscore');
// Import Underscore.string to separate object, because there are conflict functions (include, reverse, contains)
_.str = require('underscore.string');
// Mix in non-conflict functions to Underscore namespace if you want
_.mixin(_.str.exports());
// All functions, include conflict, will be available through _.str object
_.str.include('Underscore.string', 'string'); // => true
console.log(_.str.titleize(
_.str.humanize("test_titleize_humanize")
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment