index.js
function object(input, level, options) {
  var spaces = options.spaces;
  var inner = indent(level, spaces);
  var outer = indent(level - 1, spaces);

  var keys = Object.keys(input);
  if (options.sortKeys) keys.sort(naturalSort());
  var str = keys.map(function (key) {
    return inner
      + stringify(key) + ': '
      + format(input[key], level + 1, options);
  }).join(',\n');

  return [ '{', str, outer + '}' ].join('\n');
}
function object(input, level, options) {
  var spaces = options.spaces;
  var inner = indent(level, spaces);
  var outer = indent(level - 1, spaces);

  var keys = Object.keys(input);
  if (options.sortKeys) keys.sort(naturalSort());
  var str = keys.map(function (key) {
    return inner
      + stringify(key) + ': '
      + format(input[key], level + 1, options);
  }).join(',\n');

  return [ '{', str, outer + '}' ].join('\n');
}
function object ( input , level , options ) { var spaces = options . spaces ; var inner = indent ( level , spaces ) ; var outer = indent ( level - 1 , spaces ) ; var keys = Object . keys ( input ) ; if ( options . sortKeys ) keys . sort ( naturalSort ( ) ) ; var str = keys . map ( function ( key ) { return inner + stringify ( key ) + ': ' + format ( input [ key ] , level + 1 , options ) ; } ) . join ( ',\n' ) ; return [ '{' , str , outer + '}' ] . join ( '\n' ) ; }
JSON format an object directly.

@param {Object} input
@param {Number} level
@param {Object} options
@returns {String}
JSON format an object directly .