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.
google-stocks-watch
Advanced tools
Stock ticker to pull the latest stock data and calculate gain or loss based on the purchase
Stock ticker to pull the latest stock data and calculate gain or loss based on the purchase. Based on google-stocks NPM
$ npm install google-stocks-watch --save
constructor to initialize Google Stocks Watch
options
- options for the module
options.timerInterval
- (optional) how often ticker callback will be executed (in milliseconds) (default 10000)
options.stocks
- object containing initial stock purchase
stock.amount
- amount of purchased stocks
stock.price
- initial price
callback
- function callback to be executed everytimerInterval
milliseconds. Has 2 arguments:error
anddata
function to start time ticker
function to stop time ticker
property which contains initial
stocks
object
var GoogleStocksWatch = require('google-stocks-watch'),
googleStocksWatch;
var config = {
timerInterval: 8000, // milliseconds
stocks: {
'AAPL': {
amount: '2',
price: '130.10'
},
'GOOG': {
amount: '10',
price: '520.55'
}
}
};
googleStocksWatch = new GoogleStocksWatch(config, function(err, data) {
console.log(data);
});
googleStocksWatch.start();
returned format looks like this:
/**
[ { code: 'AAPL',
amount: '2',
current_time: 'May 4, 4:47PM EDT',
current_price: '128.77',
current_total_price: '257.54',
purchased_price: '130.10',
purchased_total_price: '260.20',
diff: '-2.66',
percentage: '-1.02%' },
{ code: 'GOOG',
amount: '10',
current_time: 'May 4, 4:46PM EDT',
current_price: '540.97',
current_total_price: '5409.70',
purchased_price: '520.55',
purchased_total_price: '5205.50',
diff: '204.20',
percentage: '3.92%' } ]
**/
npm run example
MIT license; see LICENSE.
FAQs
Stock ticker to pull the latest stock data and calculate gain or loss based on the purchase
The npm package google-stocks-watch receives a total of 0 weekly downloads. As such, google-stocks-watch popularity was classified as not popular.
We found that google-stocks-watch 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.