Switched from underscore to lodash library

This commit is contained in:
Sahat Yalkabov
2014-06-06 15:43:49 -04:00
parent 7621f4edf2
commit 2cbf836041
5 changed files with 6 additions and 6 deletions

View File

@ -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.

View File

@ -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;

View File

@ -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

View File

@ -1,4 +1,4 @@
var _ = require('underscore');
var _ = require('lodash');
var async = require('async');
var crypto = require('crypto');
var nodemailer = require('nodemailer');

View File

@ -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"
},