geo-spot-finder

1.0.3 • Public • Published

Geo Spot Finder

geo-spot-finder is an npm package designed to help you find the user's current geolocation using their browser. It provides an easy-to-use function to retrieve latitude and longitude and display them on your webpage.

Installation

To install the package, use the following command:

npm i geo-spot-finder

Usage

ES Module Syntax

To use the package with ES module syntax, import it as follows:

import geoLocation from './node_modules/geo-spot-finder/index.js'; 

CommonJS Syntax

To use the package with CommonJS syntax, require it as follows:

const geoLocation = require('./node_modules/geo-spot-finder/index.js');

Sample HTML Code

Here’s a sample HTML file to demonstrate how to use the geo-spot-finder package:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button onclick="geoLocation()">Click to get location</button>
    <h1 id="latitude">The latitude is: </h1>
    <br>
    <h1 id="longitude">The longitude is: </h1>
    <script src="./index.js" type="module"></script>
</body>
</html>

Sample JavaScript Code

Here’s how to include the package in your JavaScript file:

import geoLocation from './node_modules/geo-spot-finder/index.js'; 

geoLocation();

Contributions

We welcome contributions to improve the geo-spot-finder package! Feel free to submit pull requests or suggest enhancements. Your feedback and contributions are highly valued.

License

This package is licensed under the Apache License 2.0.

Dependents (0)

Package Sidebar

Install

npm i geo-spot-finder

Weekly Downloads

276

Version

1.0.3

License

Apache-2.0

Unpacked Size

15.3 kB

Total Files

5

Last publish

Collaborators

  • hrideshhhh