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

stock-info

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stock-info - npm Package Compare versions

Comparing version 1.5.1 to 1.6.0

dist/index.d.ts

2

dist/index.js

@@ -1,2 +0,2 @@

var r=require("axios"),e=function(e){return new Promise(function(n,o){return e?"string"!=typeof e?o(Error("Invalid argument type. Required: string. Found: "+typeof e)):r.get("https://query1.finance.yahoo.com/v7/finance/quote?symbols="+e,{mode:"no-cors",headers:{"Access-Control-Allow-Origin":"*","Content-Type":"application/json"},withCredentials:!0,credentials:"same-origin"}).then(function(r){var t=r.data;return t&&t.quoteResponse&&t.quoteResponse.result&&0!==t.quoteResponse.result.length?n(t.quoteResponse.result[0]):o(Error("Error retrieving info for symbol "+e))}).catch(function(r){return o(r)}):o(Error("Stock symbol required"))})};module.exports={getSingleStockInfo:e,getStocksInfo:function(r){return new Promise(function(n,o){if(!r)return o(Error("Stock symbol list required"));if(!Array.isArray(r))return o(Error("Invalid argument type. Array required."));var t=[].concat(r);if(!t.length||t.length<1)return Promise.resolve([]);var i=t.map(e);return n(Promise.all(i))})}};
function r(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}var e=/*#__PURE__*/r(require("axios")),t=function(r){return new Promise(function(t,n){if(!r)return n(Error("Stock symbol required"));if("string"!=typeof r)return n(Error("Invalid argument type. Required: string. Found: "+typeof r));var o="https://query1.finance.yahoo.com/v7/finance/quote?symbols="+r,i="undefined"!=typeof window?"https://thingproxy.freeboard.io/fetch/"+o:o;return e.default.get(i,{headers:{"Content-Type":"application/json"}}).then(function(e){var o=e.data;return o&&o.quoteResponse&&o.quoteResponse.result&&0!==o.quoteResponse.result.length?t(o.quoteResponse.result[0]):n(Error("Error retrieving info for symbol "+r))}).catch(function(r){return n(r)})})};exports.getSingleStockInfo=t,exports.getStocksInfo=function(r){return new Promise(function(e,n){if(!r)return n(Error("Stock symbol list required"));if(!Array.isArray(r))return n(Error("Invalid argument type. Array required."));var o=[].concat(r);if(!o.length||o.length<1)return Promise.resolve([]);var i=o.map(t);return e(Promise.all(i))})};
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

const e=require("axios"),r=r=>new Promise((o,t)=>r?"string"!=typeof r?t(Error("Invalid argument type. Required: string. Found: "+typeof r)):e.get(`https://query1.finance.yahoo.com/v7/finance/quote?symbols=${r}`,{mode:"no-cors",headers:{"Access-Control-Allow-Origin":"*","Content-Type":"application/json"},withCredentials:!0,credentials:"same-origin"}).then(e=>{const{data:n}=e;return n&&n.quoteResponse&&n.quoteResponse.result&&0!==n.quoteResponse.result.length?o(n.quoteResponse.result[0]):t(Error(`Error retrieving info for symbol ${r}`))}).catch(e=>t(e)):t(Error("Stock symbol required")));module.exports={getSingleStockInfo:r,getStocksInfo:e=>new Promise((o,t)=>{if(!e)return t(Error("Stock symbol list required"));if(!Array.isArray(e))return t(Error("Invalid argument type. Array required."));const n=[...e];if(!n.length||n.length<1)return Promise.resolve([]);const s=n.map(r);return o(Promise.all(s))})};
import r from"axios";const e=e=>new Promise((t,o)=>{if(!e)return o(Error("Stock symbol required"));if("string"!=typeof e)return o(Error("Invalid argument type. Required: string. Found: "+typeof e));const n=`https://query1.finance.yahoo.com/v7/finance/quote?symbols=${e}`,s="undefined"!=typeof window?"https://thingproxy.freeboard.io/fetch/"+n:n;return r.get(s,{headers:{"Content-Type":"application/json"}}).then(r=>{const{data:n}=r;return n&&n.quoteResponse&&n.quoteResponse.result&&0!==n.quoteResponse.result.length?t(n.quoteResponse.result[0]):o(Error(`Error retrieving info for symbol ${e}`))}).catch(r=>o(r))}),t=r=>new Promise((t,o)=>{if(!r)return o(Error("Stock symbol list required"));if(!Array.isArray(r))return o(Error("Invalid argument type. Array required."));const n=[...r];if(!n.length||n.length<1)return Promise.resolve([]);const s=n.map(e);return t(Promise.all(s))});export{e as getSingleStockInfo,t as getStocksInfo};
//# sourceMappingURL=index.modern.js.map

@@ -1,2 +0,2 @@

var r=require("axios"),e=function(e){return new Promise(function(n,o){return e?"string"!=typeof e?o(Error("Invalid argument type. Required: string. Found: "+typeof e)):r.get("https://query1.finance.yahoo.com/v7/finance/quote?symbols="+e,{mode:"no-cors",headers:{"Access-Control-Allow-Origin":"*","Content-Type":"application/json"},withCredentials:!0,credentials:"same-origin"}).then(function(r){var t=r.data;return t&&t.quoteResponse&&t.quoteResponse.result&&0!==t.quoteResponse.result.length?n(t.quoteResponse.result[0]):o(Error("Error retrieving info for symbol "+e))}).catch(function(r){return o(r)}):o(Error("Stock symbol required"))})};module.exports={getSingleStockInfo:e,getStocksInfo:function(r){return new Promise(function(n,o){if(!r)return o(Error("Stock symbol list required"));if(!Array.isArray(r))return o(Error("Invalid argument type. Array required."));var t=[].concat(r);if(!t.length||t.length<1)return Promise.resolve([]);var i=t.map(e);return n(Promise.all(i))})}};
import r from"axios";var e=function(e){return new Promise(function(t,n){if(!e)return n(Error("Stock symbol required"));if("string"!=typeof e)return n(Error("Invalid argument type. Required: string. Found: "+typeof e));var o="https://query1.finance.yahoo.com/v7/finance/quote?symbols="+e,i="undefined"!=typeof window?"https://thingproxy.freeboard.io/fetch/"+o:o;return r.get(i,{headers:{"Content-Type":"application/json"}}).then(function(r){var o=r.data;return o&&o.quoteResponse&&o.quoteResponse.result&&0!==o.quoteResponse.result.length?t(o.quoteResponse.result[0]):n(Error("Error retrieving info for symbol "+e))}).catch(function(r){return n(r)})})},t=function(r){return new Promise(function(t,n){if(!r)return n(Error("Stock symbol list required"));if(!Array.isArray(r))return n(Error("Invalid argument type. Array required."));var o=[].concat(r);if(!o.length||o.length<1)return Promise.resolve([]);var i=o.map(e);return t(Promise.all(i))})};export{e as getSingleStockInfo,t as getStocksInfo};
//# sourceMappingURL=index.module.js.map

@@ -1,2 +0,2 @@

!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){var e=require("axios"),r=function(r){return new Promise(function(n,o){return r?"string"!=typeof r?o(Error("Invalid argument type. Required: string. Found: "+typeof r)):e.get("https://query1.finance.yahoo.com/v7/finance/quote?symbols="+r,{mode:"no-cors",headers:{"Access-Control-Allow-Origin":"*","Content-Type":"application/json"},withCredentials:!0,credentials:"same-origin"}).then(function(e){var t=e.data;return t&&t.quoteResponse&&t.quoteResponse.result&&0!==t.quoteResponse.result.length?n(t.quoteResponse.result[0]):o(Error("Error retrieving info for symbol "+r))}).catch(function(e){return o(e)}):o(Error("Stock symbol required"))})};module.exports={getSingleStockInfo:r,getStocksInfo:function(e){return new Promise(function(n,o){if(!e)return o(Error("Stock symbol list required"));if(!Array.isArray(e))return o(Error("Invalid argument type. Array required."));var t=[].concat(e);if(!t.length||t.length<1)return Promise.resolve([]);var i=t.map(r);return n(Promise.all(i))})}}});
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("axios")):"function"==typeof define&&define.amd?define(["exports","axios"],r):r((e||self).stockInfo={},e.axios)}(this,function(e,r){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=/*#__PURE__*/t(r),o=function(e){return new Promise(function(r,t){if(!e)return t(Error("Stock symbol required"));if("string"!=typeof e)return t(Error("Invalid argument type. Required: string. Found: "+typeof e));var o="https://query1.finance.yahoo.com/v7/finance/quote?symbols="+e,i="undefined"!=typeof window?"https://thingproxy.freeboard.io/fetch/"+o:o;return n.default.get(i,{headers:{"Content-Type":"application/json"}}).then(function(n){var o=n.data;return o&&o.quoteResponse&&o.quoteResponse.result&&0!==o.quoteResponse.result.length?r(o.quoteResponse.result[0]):t(Error("Error retrieving info for symbol "+e))}).catch(function(e){return t(e)})})};e.getSingleStockInfo=o,e.getStocksInfo=function(e){return new Promise(function(r,t){if(!e)return t(Error("Stock symbol list required"));if(!Array.isArray(e))return t(Error("Invalid argument type. Array required."));var n=[].concat(e);if(!n.length||n.length<1)return Promise.resolve([]);var i=n.map(o);return r(Promise.all(i))})}});
//# sourceMappingURL=index.umd.js.map
{
"name": "stock-info",
"version": "1.5.1",
"version": "1.6.0",
"description": "Module to retrieve stock information from Yahoo Finance API",

@@ -8,2 +8,3 @@ "files": [

],
"types": "dist/index.d.ts",
"scripts": {

@@ -40,3 +41,3 @@ "test": "mocha",

},
"source": "index.js",
"source": "index.ts",
"exports": "./dist/index.modern.js",

@@ -43,0 +44,0 @@ "main": "./dist/index.cjs",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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