get-lat-long 0.0.3 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,13 +1,2 @@
1
- ###Get-lat-long
1
+ #get-lat-long
2
2
 
3
- When called with get-lat-long `city name`, eg: get-lat-long chennai
4
- `
5
- {
6
- city: 'Chennai',
7
- city_ls: 'chennai',
8
- lat: '13.0825',
9
- lng: '80.2750',
10
- country: 'India',
11
- population: '11564000'
12
- }
13
- `
package/index.js ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ 'use strict'
3
+
4
+ // const args = process.argv.slice(2)
5
+ // if (args.length < 1 || args.length > 1) {
6
+ // console.error('Invalid params provided')
7
+ // process.exit(1)
8
+ // }
9
+
10
+ import fetch from 'node-fetch'
11
+ const { loc } = await(await fetch('http://ipinfo.io/json')).json()
12
+ const [latitude, longitude] = loc.split(',')
13
+ console.log({ latitude, longitude });
package/package.json CHANGED
@@ -1,23 +1,17 @@
1
1
  {
2
2
  "name": "get-lat-long",
3
- "version": "0.0.3",
3
+ "version": "1.0.0",
4
4
  "description": "displays current location",
5
- "main": "src/index.js",
6
- "bin": "lib/index.js",
5
+ "main": "index.js",
6
+ "type": "module",
7
+ "bin": "index.js",
7
8
  "scripts": {
8
- "prepublish": "babel src --out-dir lib"
9
- },
10
- "babel": {
11
- "presets": [
12
- "@babel/preset-env"
13
- ]
9
+ "start": "node ."
14
10
  },
15
11
  "keywords": [],
16
12
  "author": "Athithyan R",
17
13
  "license": "ISC",
18
- "devDependencies": {
19
- "@babel/cli": "^7.20.7",
20
- "@babel/core": "^7.20.12",
21
- "@babel/preset-env": "^7.20.2"
14
+ "dependencies": {
15
+ "node-fetch": "^3.3.0"
22
16
  }
23
17
  }