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

nepse_api

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nepse_api - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

a.js

25

index.js
require("dotenv").config();
const URL = process.env.URL;
const URL1 = process.env.URL1; // Fetch closing price
const URL2 = process.env.URL2;
const getClosingPrice = async (symbol) => {
const res = await fetch(URL + symbol.toUpperCase());
const res = await fetch(URL1 + symbol.toUpperCase());
const data = await res.json();
const history = await fetch(URL2.replace("{}", symbol.toUpperCase()));
const data2 = await history.json();
console.log(data2);
if (data.info === null) return null;
// Just return name, closing price and percentage change
data.info === null
? null
: {
name: data["info"]["full_name"],
price: data["price"]["today_price"],
percentage_change: data["price"]["percent_change"],
};
const d = {
name: data["info"]["full_name"],
price: data["price"]["today_price"],
percentage_change: data["price"]["percent_change"],
};
return d;
};
module.exports = { getClosingPrice };
{
"name": "nepse_api",
"version": "1.0.0",
"description": "Simple NEPSE API to get close price of Stocks",
"version": "1.0.1",
"description": "Simple NEPSE API Wrapper to get closing price of Stocks",
"main": "index.js",

@@ -6,0 +6,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

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