Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vvansh739/weather-package

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vvansh739/weather-package - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

test.js

14

dist/index.js

@@ -9,7 +9,7 @@ "use strict";

const dotenv_1 = __importDefault(require("dotenv"));
// Load environment variables from .env file
dotenv_1.default.config();
const API_KEY = process.env.OPENWEATHERMAP_API_KEY;
const API_URL = "http://api.openweathermap.org/data/2.5/weather";
const BASE_URL = 'https://api.openweathermap.org/data/2.5/weather';
if (!API_KEY) {
console.error("API_KEY is not set");
throw new Error('Missing OpenWeatherMap API key in environment variables');

@@ -19,11 +19,11 @@ }

try {
const response = await axios_1.default.get(API_URL, {
const response = await axios_1.default.get(BASE_URL, {
params: {
q: city,
units: "metric",
appid: API_KEY
appid: API_KEY,
units: 'metric'
}
});
const { weather, main, wind, name } = response.data;
console.log(`Weather in ${name}`);
console.log(`Weather in ${name}:`);
console.log(`Description: ${weather[0].description}`);

@@ -35,4 +35,4 @@ console.log(`Temperature: ${main.temp}°C`);

catch (error) {
console.error("Error fetching weather data", error);
console.error('Error fetching weather data:', error);
}
}
{
"name": "@vvansh739/weather-package",
"version": "1.0.1",
"version": "1.0.2",
"description": "A simple module to fetch and display current weather information",

@@ -22,3 +22,3 @@ "main": "dist/index.js",

"dependencies": {
"@vvansh739/weather-package": "^1.0.0",
"@vvansh739/weather-package": "^1.0.1",
"axios": "^1.7.2",

@@ -25,0 +25,0 @@ "dotenv": "^16.4.5"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc