Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michaelwp/js-distance
https://github.com/michaelwp/js-distance
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/michaelwp/js-distance
- Owner: michaelwp
- License: mit
- Created: 2021-04-16T02:00:27.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-25T15:40:40.000Z (almost 4 years ago)
- Last Synced: 2024-01-30T07:00:10.656Z (about 1 year ago)
- Language: JavaScript
- Size: 58.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# js-distance v1.0.0
Ini adalah package nodejs sederhana untuk menghitung jarak antara dua titik koordinat latitude dan longitude.
### Contoh penggunaan
```javascript
const jsDistance = require("./js-distance");const jsDistanceObj = new jsDistance(
-6.2973856, // origin latitude
106.6388177, // origin longitude
-6.3027637, // destination latitude
106.6410986 // destination longitude
)console.log(jsDistanceObj.count().toMiles()); // to miles (default)
console.log(jsDistanceObj.count().toKilometre()); // to kilometre
```
#### Hasil
```text
0.5238991320272929 mil
0.8431339247333317 km
```