Convert zip codes to addresses and back with ease using this command-line tool, fueled by the OneMap API. π
- Clone this repository or download the code.
- Navigate to the project directory in your terminal.
- Install the necessary dependencies:
npm install axios dotenv commander fs
- Install TypeScript and ts-node globally:
npm install -g typescript ts-node
- Create a .env file in the project directory and add your OneMap API key:
ONEMAP_API_KEY=your_api_key_here
To convert a zip code to an address, use this command:
ts-node index.ts --zipcode <zipcode>
To convert an address to a zip code, run this command:
ts-node index.ts --address "<address>"
To save addresses for a zip code to a file, add the --file flag:
ts-node index.ts --zipcode <zipcode> --file
ts-node index.ts --zipcode 123456
ts-node index.ts --address "10 Downing St, Westminster, London"