JSPM

searching-customer-within-a-range

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q34325F
  • License MIT

Searching algorithm - Reading the full list of customers (within 100km), Calculating distance between two latitude-longitude points (Haversine formula)

Package Exports

  • searching-customer-within-a-range

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (searching-customer-within-a-range) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Requirements

-We have some customer records in a text file (customers.txt) -- one customer per line, JSON lines formatted. We want to invite any customer within 100km of Dublin for some food and drinks on us. Write a program that will read the full list of customers and output the names and user ids of matching customers (within 100km), sorted by User ID (ascending). -Don't forget, you'll need to convert degrees to radians. -The GPS coordinates for Dublin area is 53.339428, -6.257664. We're looking for you to produce working code, with enough room to demonstrate how to structure components in a small program. Package the searching algorithm as an abstraction layer and installable component through npm package.

Usage

Require

let filterCustomer = require('searching-customer-within-a-range');
or
import filterCustomer from 'searching-customer-within-a-range';
filterCustomer.searchingCustomers().catch((err) => {
  console.log(`Error received: `, err.message);
}).then((eligibleCustomers) => {
  console.log(eligibleCustomers);
});

Testing Repo

https://github.com/ishwarchandratiwari/testingnpmpackage-searching-customer-within-a-range

just hit: npm install; npm start;