Embedded_Mugs
Embedded_Mugs

Reputation: 2426

How do I log all the properties of an npm module in a pretty manner?

Id like to know all the methods and properties of something like GoogleMapReact I tried the following:

import GoogleMapReact from 'google-map-react'
console.log(GoogleMapReact);

But it returns this really giant, dirty one-line string thats hard to read.

Upvotes: 0

Views: 270

Answers (1)

Amstrong Monachello
Amstrong Monachello

Reputation: 7

Is not efficient use console.log().

You can do multiple options:

  1. You can press (Command on Mac / Ctrl on Windows) and click in GoogleMapReact import, its gonna open the library file. You can find all the methods.

  2. The best way for me: consult the documentation. You are looking for Google-map-react. API references has all the methods: https://github.com/google-map-react/google-map-react/blob/master/API.md

Upvotes: 1

Related Questions