1.0.5 โข Published 10 months ago
montu-test-lib v1.0.5
QuickRoute's Address Suggestion API
//: <> (end placeholder for auto-badger)
Usage ๐
const tomTomProvider = new TomTomProvider({ apiKey: 'your_api_key_here' });
const addressService = new AddressService(tomTomProvider);
addressService.getSuggestions('1600 Amphitheatre', { limit: 5, countryCode: 'AU' })
.then((suggestions) => console.log(suggestions))
.catch((error) => console.error(error));prerequisites ๐ ๏ธ
- Install NodeJs / NPM
# On MacOS, using Homebrew
brew install node@20
brew install npm- Install Axios - https://www.npmjs.com/package/axios
npm install --save-dev typescript @types/node tsup vitest axios axios-mock-adapterBuild Locally ๐ป
- Build ๐งฑ
npm run build- Test ๐งช
npm testPublish to NPM repository ๐ฆ
- Update the lib version in package.json
- Tag and commit
git tag <version>
git push origin --tags- Create a release on the repo, github-action should build, test and publish to npm.
References
- How to Write a TypeScript Library https://simonboisset.com/blog/create-typescript-library-tsup