Closed fabriziomoscon closed 9 years ago
:+1:
I leave this here as a reference: http://fredkschott.com/post/2014/01/node-js-cookbook---constructors-and-custom-types/
this work has started: https://github.com/moshen/node-googlemaps/tree/new-major-version
npm test
components
parameter to geocode methodconsole-key
config parameterPR #70 addresses this issue
Since the library doesn't export a constructor the
_config
object is global for all the calls you make within the same running process. This prevent the execution of multiple API calls that requires different configuration keys. For example running a simple geocoding as Business user will setgoogle-client-id
andgoogle-private-key
globally also for calls to the place API that don't need them.Because of the way
require
works in node http://nodejs.org/api/modules.html#modules_caching I cannot use 2 library in my code as a workaround.Exporting a constructor would allow users to have multiple objects which don't share
_config