diff --git a/README.md b/README.md index 8a8320c4bb..9c2168f884 100644 --- a/README.md +++ b/README.md @@ -387,7 +387,7 @@ List of Packages | tumblr.js | Tumblr API library. | | twilio | Twilio API library. | | twit | Twitter API library. | -| underscore | Handy JavaScript utlities library. | +| lodash | Handy JavaScript utlities library. | | uglify-js | Dependency for connect-assets library to minify JS. | | validator | Used in conjunction with express-validator in **controllers/api.js**. | | mocha | Test framework. | @@ -458,7 +458,7 @@ asynchronous tasks, and then render a page, but only when all tasks are complete want to scrape 3 different websites for some data and render the results in a template after all 3 websites have been scraped. - Need to find a specific object inside an Array? Use [_.findWhere](http://underscorejs.org/#findWhere) -function from Underscore.js. For example, this is how you would retrieve a +function from Underscore.js (or Lodash). For example, this is how you would retrieve a Twitter token from database: `var token = _.findWhere(req.user.tokens, { kind: 'twitter' });`, where 1st parameter is an array, and a 2nd parameter is an object to search for. diff --git a/config/passport.js b/config/passport.js index 4bacdda73a..cf0d27aabd 100755 --- a/config/passport.js +++ b/config/passport.js @@ -1,4 +1,4 @@ -var _ = require('underscore'); +var _ = require('lodash'); var passport = require('passport'); var InstagramStrategy = require('passport-instagram').Strategy; var LocalStrategy = require('passport-local').Strategy; diff --git a/controllers/api.js b/controllers/api.js index 4a9af0759e..ef58ffe7bf 100644 --- a/controllers/api.js +++ b/controllers/api.js @@ -17,7 +17,7 @@ var Linkedin = require('node-linkedin')(secrets.linkedin.clientID, secrets.linke var clockwork = require('clockwork')({key: secrets.clockwork.apiKey}); var ig = require('instagram-node').instagram(); var Y = require('yui/yql'); -var _ = require('underscore'); +var _ = require('lodash'); /** * GET /api diff --git a/controllers/user.js b/controllers/user.js index 582e62b60d..a695d1b281 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -1,4 +1,4 @@ -var _ = require('underscore'); +var _ = require('lodash'); var async = require('async'); var crypto = require('crypto'); var nodemailer = require('nodemailer'); diff --git a/package.json b/package.json index e2ae40a732..3ddb506c33 100755 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "jade": "^1.3.1", "lastfm": "^0.9.0", "less": "^1.7.0", + "lodash": "^2.4.1", "lusca": "^1.0.0", "method-override": "^2.0.0", "mongoose": "^3.8.12", @@ -53,7 +54,6 @@ "twilio": "^1.6.0", "twit": "^1.1.15", "uglify-js": "^2.4.13", - "underscore": "^1.6.0", "validator": "^3.12.0", "yui": "^3.17.1" },