Skip to content

Experience the magic of this Node.js CLI tool! It effortlessly transforms Singapore zip codes into addresses and vice versa. πŸ‡ΈπŸ‡¬βœ¨ Powered by the OneMap API, it even lets you save these converted addresses to a handy JSON file. Simply provide the zip code or address, specify your output format, and let the tool work its charm. πŸš€

minmyatoo/sg-zipcode-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

61 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ™οΈ Zip Code and Address Converter

Convert zip codes to addresses and back with ease using this command-line tool, fueled by the OneMap API. πŸš€

Prerequisites πŸ› οΈ

Installation πŸ“¦

  1. Clone this repository or download the code.
  2. Navigate to the project directory in your terminal.
  3. Install the necessary dependencies:
npm install axios dotenv commander fs
  1. Install TypeScript and ts-node globally:
npm install -g typescript ts-node
  1. Create a .env file in the project directory and add your OneMap API key:
ONEMAP_API_KEY=your_api_key_here

Usage πŸ“

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

Example 🌟

ts-node index.ts --zipcode 123456
ts-node index.ts --address "10 Downing St, Westminster, London"

About

Experience the magic of this Node.js CLI tool! It effortlessly transforms Singapore zip codes into addresses and vice versa. πŸ‡ΈπŸ‡¬βœ¨ Powered by the OneMap API, it even lets you save these converted addresses to a handy JSON file. Simply provide the zip code or address, specify your output format, and let the tool work its charm. πŸš€

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published