ved-biz2credit-test
v1.0.0
Published
It is a basic package for a test conducted by biz2credit. This package exposes a function getCustomersList which reads a text file (customers.txt) present inside module having list of customers and returns a json array of objects of users (within 100km) h
Downloads
1
Readme
ved-biz2credit-test
It is a basic package for a test conducted by biz2credit. This package exposes a function getCustomersList which reads a text file (customers.txt) present inside module having list of customers and returns a json array of objects of users (within 100km) having userIds and names.
Usage
First, install the package using npm:
npm install ved-biz2credit-test --save
Then, require the package and use it like so:
const vedBiz2CreditTest = require('ved-biz2credit-test');
users = vedBiz2CreditTest.getCustomersList(filePath, geoAreaLat, geoAreaLong, distance);
console.log(users);
here passed parameters are,
filePath: string - filePath is the full path of file having user data
geoAreaLat: string - latitute of geo area
geoAreaLong: string - longitude of geo area
distance: integer - distance within which users should filtered for invitation
for example, for dublin, GPS coordinates ('53.339428', '-6.257664') we want to invite users within 100km
users = vedBiz2CreditTest.getCustomersList('customers.txt', '53.339428', '-6.257664', 100);
console.log(users);
if no parameters are provided then default parameters of dublin geo area are used. i.e,
filePath = 'customers.txt',
geoAreaLat = '53.339428',
geoAreaLong = '-6.257664',
distance = 100