node-postal
node-postal copied to clipboard
Expose options like in pypostal
pypostal has all of these options available: https://github.com/openvenues/pypostal/blob/master/postal/expand.py#L17-L51
node-postal has direct-to-c sorcery: expand: require('bindings')('expand')
. It looks like you can't pass options in (and I couldn't by trial and error).
Is there a way to expose options for the node binding? Or if you can use them, how?
Thanks
The options are exposed in node-postal (not really documented though) and can be passed in as a second argument in a JS object:
var postal = require('node-postal');
postal.expand.expand_address('Pine St', {'address_components': postal.expand.ADDRESS_STREET});
The source for node-postal expand is mostly C/C++, options can be found here: https://github.com/openvenues/node-postal/blob/master/src/expand.cc#L61-L98
transliterate
option doesn't seem to affect the results: setting it to false
doesn't prevent transliterated results from appearing.