index.js
function recent(views, options) {
  options = options || {};
  var prop = options.prop || 'data.date';
  var limit = options.limit || 10;

  var res = {};

  for (var key in views) {
    if (views.hasOwnProperty(key)) {
      var date = createdDate(key, views[key], prop);
      res[date] = res[date] || [];
      res[date].push(key);
    }
  }

  var keys = Object.keys(res).sort();
  var len = keys.length;
  var num = 0;
  var acc = {};

  while (len-- && num < limit) {
    var arr = res[keys[len]];
    for (var j = 0; j < arr.length; j++) {
      var key = arr[j];
      acc[key] = views[key];
      num++;
      if (num > limit) break;
    }
  }
  return acc;
}
function recent(views, options) {
  options = options || {};
  var prop = options.prop || 'data.date';
  var limit = options.limit || 10;

  var res = {};

  for (var key in views) {
    if (views.hasOwnProperty(key)) {
      var date = createdDate(key, views[key], prop);
      res[date] = res[date] || [];
      res[date].push(key);
    }
  }

  var keys = Object.keys(res).sort();
  var len = keys.length;
  var num = 0;
  var acc = {};

  while (len-- && num < limit) {
    var arr = res[keys[len]];
    for (var j = 0; j < arr.length; j++) {
      var key = arr[j];
      acc[key] = views[key];
      num++;
      if (num > limit) break;
    }
  }
  return acc;
}
function recent ( views , options ) { options = options || { } ; var prop = options . prop || 'data.date' ; var limit = options . limit || 10 ; var res = { } ; for ( var key in views ) { if ( views . hasOwnProperty ( key ) ) { var date = createdDate ( key , views [ key ] , prop ) ; res [ date ] = res [ date ] || [ ] ; res [ date ] . push ( key ) ; } } var keys = Object . keys ( res ) . sort ( ) ; var len = keys . length ; var num = 0 ; var acc = { } ; while ( len -- && num < limit ) { var arr = res [ keys [ len ] ] ; for ( var j = 0 ; j < arr . length ; j ++ ) { var key = arr [ j ] ; acc [ key ] = views [ key ] ; num ++ ; if ( num > limit ) break ; } } return acc ; }
Return the most recent items on an object.

```
var top10 = recent(posts);
```

@param  {Object} `views` Object hash of items.
@param  {Object} `options` Options to determine limit and property to sort on.
@return {Object} Object of most recent items.
@api public
Return the most recent items on an object .