Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
finance-stock-info
Advanced tools
Module to retrieve current stock information from Alpha Vantage API
Module to retrieve current stock information from Alpha Vantage API.
npm i finance-stock-info
const { StockInfo } = require('finance-stock-info');
// Insert your RapidApi API Key:
const myApiKey = '<MYAPIKEY>';
// Instantiate a new StockInfo class
const stock = new StockInfo(myApiKey);
// Use these methods to return you a Promise:
stock.getStockInfo('tsla').then((info) => console.log(info));
/*
{
'Global Quote': {
'01. symbol': 'TSLA',
'02. open': '729.6750',
'03. high': '743.3899',
'04. low': '700.2534',
'05. price': '703.5500',
'06. volume': '37464579',
'07. latest trading day': '2022-06-03',
'08. previous close': '775.0000',
'09. change': '-71.4500',
'10. change percent': '-9.2194%'
}
}
*/
stock.getPrice('tsla').then((price) => console.log(price));
// 703.5500
stock.getTotalValue('tsla', 3).then((value) => console.log(value));
// 2110.6499999999996
stock.getChangePercent('twtr').then((percent) => console.log(percent));
// 0.6264%
stock.getTradeVolume('twtr').then((volume) => console.log(volume));
// 18269884
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
To run tests:
tests/test.js
file. Then run:npm test
To check code test coverage:
npx jest --coverage
FAQs
Module to retrieve current stock information from Alpha Vantage API
We found that finance-stock-info demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.