Validation for Longitude & Latitude
npm install validation-latitude-longitudeTiny package for validating latitude & longitude string format.
``js`
/ example /
const isValidStrings = ["40.6892", "74.0445"];
validationLatitudeLongitude.latLong(...isValidStrings); // true π½
#
1. Valid Latitude and/or Longitude returns true.false
2. Invalid returns .
#
Less-than < 1.5 kilobytes
#
`bash
npm install validation-latitude-longitude
yarn add validation-latitude-longitude
`
`js`
import { validationLatitudeLongitude } from "validation-latitude-longitude";
`js
/ Valid Latitude Format? /
validationLatitudeLongitude.latitude(MY_LATITUDE);
/ Valid Longitude Format? /
validationLatitudeLongitude.longitude(MY_LONGITUDE);
/ Valid Latitude & Longitude Formats? /
validationLatitudeLongitude.latLong(MY_LATITUDE, MY_LONGITUDE);
`
#
![]()
##### \\\* New package
1. Setup an npm account. (if not done aleardy)
2. Create a package.json (snippet below) at application root and set version 1.0.0 to start. \\\* If open source, set the license to MIT. π€npm login
3. Push changes to your git repo.
4. npm publish
5.
`json`
{
"name": "unique-npm-project-name",
"version": "1.0.0",
"description": "Descripton of my application",
"main": "index.min.js",
"license": "MIT",
"keywords": ["list", "of", "searchable", "key", "words"]
}
##### \\\* update package
1. Push changes to your git repo
2. npm loginnpm version
3. with new numbernpm publish
4.
`bash`updating version example
npm verison 1.0.1
##### \\\* am i still logged in?
1. npm whoami`
#