Find a list of customers who are close to the proximity (in KM). Mainly used to create a invitation list of customers within a certain radius of the event.
[sudo] npm i -g invite-list-jr
The program expects 2 inputs while looking for the right information:
- Customer records in a text file (customers.txt) -- one customer per line, JSON-encoded. Example here.
config.json
file, with the structure and information here.
Once you have the above information, run the following command:
invite-list-jr --f=[location to customers.txt] --c=[location to config.json]
This will give you a list of customers within in the proximity defined and number of results.
For easiness, we have provided a customers.txt and config.json example to get started with.
Currently the program uses haversine function to calculate the distance and convert it to KM's. That said, we have an option to change the program to use spherical law of cosines here.
For more information regarding the algorithms, please refer to https://en.wikipedia.org/wiki/Great-circle_distance.
- Allow the algorithm to be configurable.
- Ability to write the results to a file and convert it to .csv for easy export.
git clone [email protected]:jeremyrajan/invite-list-jr.git
npm install
gulp # starts a watcher
npm test # to run the tests using jest