Node gm - resize image and preserve aspect ratio?

Does Node gm have built-in support for resizing an image while preserving aspect ratio (ie., generating a thumbnail)? Or should I get the image size, calculate the proper ratio, and then call resize?

This question is inspired by PIL's similar functionality.

Jonathan's comment is the solution:

gm().resize(maxSize)

This resizes the image's largest dimension to maxSize.