How to use the now function from lodash

Find comprehensive JavaScript lodash.now code examples handpicked from public code repositorys.

195
196
197
198
199
200
201
202
203
204
this.serverless.utils.writeFileSync(compositePackageJson, '{}');

this.serverless.cli.log('Packing external modules: ' + compositeModules.join(', '));

return new BbPromise((resolve, reject) => {
  const start = _.now();
  npm.install(compositeModules, {
    cwd: compositeModulePath,
    maxBuffer: this.serverless.service.custom.packExternalModulesMaxBuffer || 200 * 1024,
    save: true
fork icon409
star icon0
watch icon2

785
786
787
788
789
790
791
792
793
794

try {
	this.chainFilter = web3.eth.filter('latest');
	this.chainFilter.watch( function (err, hash)
	{
		var now = _.now();
		var time = now - self._lastChainLog;
		self._lastChainLog = now;

		if(hash === null)
fork icon353
star icon327
watch icon28

+ 19 other calls in file

6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
 * @static
 * @memberOf _
 * @category Utilities
 * @example
 *
 * var stamp = _.now();
 * _.defer(function() { console.log(_.now() - stamp); });
 * // => logs the number of milliseconds it took for the deferred function to be called
 */
var now = isNative(now = Date.now) && now || function() {
fork icon73
star icon711
watch icon29

275
276
277
278
279
280
281
282
283
284
module.exports.negate              = _.negate;
module.exports.neq                 = _.neq;
module.exports.noConflict          = _.noConflict;
module.exports.noop                = _.noop;
module.exports.not                 = _.not;
module.exports.now                 = _.now;
module.exports.nth                 = _.nth;
module.exports.nthArg              = _.nthArg;
module.exports.nths                = _.nths;
module.exports.omit                = _.omit;
fork icon19
star icon122
watch icon0

+ 92 other calls in file

284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
console.log(sortBy); // => [3, 1, 2]




// Date


const now = _.now();
console.log(now); // => 1490719810000




// Function
fork icon0
star icon4
watch icon0

+ 15 other calls in file

52
53
54
55
56
57
58
59
60
61
const dbQuery = () => dbService.helper.query().table(table);
const ensureMaxApiKeysLimitNotReached = async (requestContext, { uid }) => {
  const existingApiKeys = await this.getApiKeys(requestContext, { uid });
  const existingActiveApiKeys = _.filter(existingApiKeys, apiKey => {
    const isActive = apiKey.status === 'active';
    const isExpired = apiKey.expiryTime && _.now() > apiKey.expiryTime;
    return isActive && !isExpired;
  });
  if (existingActiveApiKeys.length >= maxActiveApiKeysPerUser) {
    throw this.boom.maxApiKeysLimitReached(
fork icon0
star icon0
watch icon1

+ 3 other calls in file

228
229
230
231
232
233
234
235
236
237
238
239
// console.log(
//   "unique value intersection",
//   lodash.intersection(arrq1, arrq2, arrq3, arrq4)
// );


// const milliseconds = lodash.now();
// const now = new Date(milliseconds);


// // now.toLocaleString() 11/4/2023, 11:56:49 am
// console.log("toLocaleString", now.toLocaleString());
fork icon0
star icon0
watch icon0

+ 9 other calls in file

216
217
218
219
220
221
222


//*** Date method */


// _.now() returns the current time stamp
log(new Date(_.now()).toLocaleDateString())
fork icon0
star icon0
watch icon0

Other functions in lodash

Sorted by popularity

function icon

lodash.get is the most popular function in lodash (7670 examples)