format-general-location
v1.0.3
Published
Takes an object of a general location and returns a formatted string.
Downloads
17
Maintainers
Readme
format-general-location
Takes an object of a general location and returns a formatted string.
install
npm install format-general-locationexample
const formatLocation = require('format-general-location')
formatLocation({
city: 'Springfield',
state, 'TN'
postalCode: 37172,
country: 'US'
}) // -> "Springfield, TN 37172, US
formatLocation({
city: 'Springfield',
postalCode: 37172,
}) // -> "Springfield, 37172API
formatLocation(location)
location: objectcity: stringstate: stringpostalCode: string | numbercountry: string
- returns:
stringformatted location
