Convert zip codes to addresses and back with ease using this command-line tool, fueled by the OneMap API. π
- Node.js (Version 18 or higher recommended)
- Clone this repository or download the code.
- Navigate to the project directory in your terminal.
- Install the necessary dependencies:
npm installTo convert a zip code to an address, use this command:
npx ts-node src/index.ts --zipcode <zipcode>Or use the npm script:
npm run zipcode -- <zipcode>To convert an address to a zip code, run this command:
npx ts-node src/index.ts --address "<address>"To save addresses for a zip code to a file, add the --file flag:
npx ts-node src/index.ts --zipcode <zipcode> --filenpm run zipcode -- 123456npx ts-node src/index.ts --address "Plaza Singapura"