onemap-address-search-singapore
v1.0.2
Published
Search Singapore addresses by postal code using OneMAP API
Downloads
156
Maintainers
Readme
onemap-address-search-singapore
Helper library to get Singapore address by postal code using OneMap API (https://docs.onemap.sg/)
Installation
# using npm
npm install onemap-address-search-singapore
# using yarn
yarn add onemap-address-search-singapore
Usage
# using require
const { getAddress } = require('onemap-address-search-singapore');
# using import
import { getAddress } from 'onemap-address-search-singapore';
Example
Using promises:
getAddress({
postalCode: '178897' // provide Singapore postal code
}).then((address) => console.log(address));
Using async/await:
const getAddress = async function () {
const address = await getAddress({
postalCode: '178897' // provide Singapore postal code
});
console.log(address);
};
getAddress();