Socket
Socket
Sign inDemoInstall

investors-exchange.api

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

investors-exchange.api - npm Package Compare versions

Comparing version 0.1.12 to 0.1.13

34

dist/index.js

@@ -1,23 +0,13 @@

(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define(["require", "exports", "./lib", "./reference", "./stock"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// Dependencies.
const lib_1 = require("./lib");
exports.fetch = lib_1.fetch;
const reference_1 = require("./reference");
exports.reference = reference_1.reference;
const stock_1 = require("./stock");
const stock = (symbol) => new stock_1.stock(symbol);
exports.stock = stock;
const market = stock('market');
exports.market = market;
});
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// Dependencies.
const lib_1 = require("./lib");
exports.fetch = lib_1.fetch;
const reference_1 = require("./reference");
exports.reference = reference_1.reference;
const stock_1 = require("./stock");
const stock = (symbol) => new stock_1.stock(symbol);
exports.stock = stock;
const market = stock('market');
exports.market = market;
//# sourceMappingURL=index.js.map

@@ -1,30 +0,28 @@

(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define(["require", "exports", "axios"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// Dependencies.
const axios_1 = require("axios");
// Base URL.
const base = 'https://api.iextrading.com/1.0';
// Fetch.
exports.fetch = async (path, params) => {
const parameters = params ? Object.entries(params) : '';
const query = parameters ? parameters.reduce((query, [key, value], i) => `${query}${i > 0 ? '&' : ''}${key}=${value}`, '?') : '';
const url = `${base}${path}${query}`;
return (await axios_1.default.get(url)).data;
};
// Is Array.
exports.isArray = (x) => x && Array.isArray(x);
// Is Number.
exports.isNumber = (x) => x && !isNaN(Number(x));
// Not Object.
exports.notAnObject = (x) => typeof x !== 'object' || Array.isArray(x);
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
// Dependencies.
const axios_1 = require("axios");
// Base URL.
const base = 'https://api.iextrading.com/1.0';
// Fetch.
exports.fetch = (path, params) => __awaiter(this, void 0, void 0, function* () {
const parameters = params ? Object.entries(params) : '';
const query = parameters ? parameters.reduce((query, [key, value], i) => `${query}${i > 0 ? '&' : ''}${key}=${value}`, '?') : '';
const url = `${base}${path}${query}`;
return (yield axios_1.default.get(url)).data;
});
// Is Array.
exports.isArray = (x) => x && Array.isArray(x);
// Is Number.
exports.isNumber = (x) => x && !isNaN(Number(x));
// Not Object.
exports.notAnObject = (x) => typeof x !== 'object' || Array.isArray(x);
//# sourceMappingURL=index.js.map

@@ -1,13 +0,3 @@

(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define(["require", "exports"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
});
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map

@@ -1,30 +0,28 @@

(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define(["require", "exports", "../lib"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// Dependencies.
const lib_1 = require("../lib");
// Path.
const path = (extension) => `/ref-data${extension}`;
// Reference.
exports.reference = {
// Corporate Actions.
corporate_actions: async (date) => await lib_1.fetch(path(`/daily-list/corporate-actions${date ? `/${date}` : ''}`)),
// Dividends.
dividends: async (date) => await lib_1.fetch(path(`/daily-list/dividends${date ? `/${date}` : ''}`)),
// Next Day Ex Date.
next_day_ex_date: async (date) => await lib_1.fetch(path(`/daily-list/next-day-ex-date${date ? `/${date}` : ''}`)),
// Symbols.
symbols: async (format = 'json') => await lib_1.fetch(path('/symbols'), { format }),
// Symbol Directory.
symbol_directory: async (date) => await lib_1.fetch(path(`/daily-list/symbol-directory${date ? `/${date}` : ''}`))
};
});
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
// Dependencies.
const lib_1 = require("../lib");
// Path.
const path = (extension) => `/ref-data${extension}`;
// Reference.
exports.reference = {
// Corporate Actions.
corporate_actions: (date) => __awaiter(this, void 0, void 0, function* () { return yield lib_1.fetch(path(`/daily-list/corporate-actions${date ? `/${date}` : ''}`)); }),
// Dividends.
dividends: (date) => __awaiter(this, void 0, void 0, function* () { return yield lib_1.fetch(path(`/daily-list/dividends${date ? `/${date}` : ''}`)); }),
// Next Day Ex Date.
next_day_ex_date: (date) => __awaiter(this, void 0, void 0, function* () { return yield lib_1.fetch(path(`/daily-list/next-day-ex-date${date ? `/${date}` : ''}`)); }),
// Symbols.
symbols: (format = 'json') => __awaiter(this, void 0, void 0, function* () { return yield lib_1.fetch(path('/symbols'), { format }); }),
// Symbol Directory.
symbol_directory: (date) => __awaiter(this, void 0, void 0, function* () { return yield lib_1.fetch(path(`/daily-list/symbol-directory${date ? `/${date}` : ''}`)); })
};
//# sourceMappingURL=index.js.map

@@ -1,95 +0,93 @@

(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
// Dependencies.
const lib_1 = require("../lib");
// Stock.
class stock {
// Constructor.
constructor(symbol) {
// Book.
this.book = () => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/book'); });
// Chart.
this.chart = (range) => __awaiter(this, void 0, void 0, function* () { return yield this.handle(`/chart/${range || '1m'}`); });
// Collection.
this.collection = (type, name) => __awaiter(this, void 0, void 0, function* () { return yield this.handle(`/collection/${type}`, { collectionName: name }); });
// Company.
this.company = () => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/company'); });
// Crypto.
this.crypto = () => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/crypto'); });
// Delayed Quote.
this.delayed_quote = () => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/delayed_quote'); });
// Dividends.
this.dividends = (range) => __awaiter(this, void 0, void 0, function* () { return yield this.handle(`/dividends/${range || '1m'}`); });
// Earnings.
this.earnings = () => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/earnings'); });
// Effective Spread.
this.effective_spread = () => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/effective-spread'); });
// Financials.
this.financials = (options) => __awaiter(this, void 0, void 0, function* () { return yield this.handle(this.path('/financials'), options); });
// Handle.
this.handle = (route, params) => __awaiter(this, void 0, void 0, function* () {
const { path } = this;
return yield lib_1.fetch(path(route), params);
});
// IPOS.
this.ipos = (when) => __awaiter(this, void 0, void 0, function* () { return yield this.handle(`/${when || 'upcoming'}-ipos`); });
// Historical Prices.
this.historical = this.chart;
// Largest Trades.
this.largest_trades = () => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/largest-trades'); });
// List.
this.list = (category) => __awaiter(this, void 0, void 0, function* () { return yield this.handle(`/list/${category}`); });
// Logo.
this.logo = () => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/logo'); });
// News.
this.news = (last) => __awaiter(this, void 0, void 0, function* () { return yield this.handle(`/news/last/${last || 1}`); });
// OHLC.
this.ohlc = () => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/ohlc'); });
// Open Close.
this.openclose = this.ohlc;
// Path.
this.path = (extension) => `/stock/${this.symbol}${extension}`;
// Peers.
this.peers = () => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/peers'); });
// Price.
this.price = () => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/price'); });
// Previous.
this.previous = () => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/previous'); });
// Quote.
this.quote = (options) => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/quote', options); });
// Relevant.
this.relevant = () => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/relevant'); });
// Sector Performance.
this.sector_performance = () => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/sector-performance'); });
// Short Interest.
this.short_interest = (date) => __awaiter(this, void 0, void 0, function* () { return yield this.handle(`/short-interest/${date || ''}`); });
// Splits.
this.splits = (range) => __awaiter(this, void 0, void 0, function* () { return yield this.handle(`/splits/${range || '1m'}`); });
// Effective Spread.
this.spread = this.effective_spread;
// Key Statistics.
this.stats = () => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/stats'); });
// Regulation SHO Threshold Securities.
this.threshold_securities = (date) => __awaiter(this, void 0, void 0, function* () { return yield this.handle(`/threshold-securities/${date || ''}`); });
// Time Series.
this.time_series = this.chart;
// Today Earnings.
this.today_earnings = () => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/today-earnings'); });
// Volume By Venue.
this.volume_by_venue = () => __awaiter(this, void 0, void 0, function* () { return yield this.handle('/volume-by-venue'); });
this.symbol = (symbol || 'market').toLowerCase();
return this;
}
else if (typeof define === "function" && define.amd) {
define(["require", "exports", "../lib"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// Dependencies.
const lib_1 = require("../lib");
// Stock.
class stock {
// Constructor.
constructor(symbol) {
// Book.
this.book = async () => await this.handle('/book');
// Chart.
this.chart = async (range) => await this.handle(`/chart/${range || '1m'}`);
// Collection.
this.collection = async (type, name) => await this.handle(`/collection/${type}`, { collectionName: name });
// Company.
this.company = async () => await this.handle('/company');
// Crypto.
this.crypto = async () => await this.handle('/crypto');
// Delayed Quote.
this.delayed_quote = async () => await this.handle('/delayed_quote');
// Dividends.
this.dividends = async (range) => await this.handle(`/dividends/${range || '1m'}`);
// Earnings.
this.earnings = async () => await this.handle('/earnings');
// Effective Spread.
this.effective_spread = async () => await this.handle('/effective-spread');
// Financials.
this.financials = async (options) => await this.handle(this.path('/financials'), options);
// Handle.
this.handle = async (route, params) => {
const { path } = this;
return await lib_1.fetch(path(route), params);
};
// IPOS.
this.ipos = async (when) => await this.handle(`/${when || 'upcoming'}-ipos`);
// Historical Prices.
this.historical = this.chart;
// Largest Trades.
this.largest_trades = async () => await this.handle('/largest-trades');
// List.
this.list = async (category) => await this.handle(`/list/${category}`);
// Logo.
this.logo = async () => await this.handle('/logo');
// News.
this.news = async (last) => await this.handle(`/news/last/${last || 1}`);
// OHLC.
this.ohlc = async () => await this.handle('/ohlc');
// Open Close.
this.openclose = this.ohlc;
// Path.
this.path = (extension) => `/stock/${this.symbol}${extension}`;
// Peers.
this.peers = async () => await this.handle('/peers');
// Price.
this.price = async () => await this.handle('/price');
// Previous.
this.previous = async () => await this.handle('/previous');
// Quote.
this.quote = async (options) => await this.handle('/quote', options);
// Relevant.
this.relevant = async () => await this.handle('/relevant');
// Sector Performance.
this.sector_performance = async () => await this.handle('/sector-performance');
// Short Interest.
this.short_interest = async (date) => await this.handle(`/short-interest/${date || ''}`);
// Splits.
this.splits = async (range) => await this.handle(`/splits/${range || '1m'}`);
// Effective Spread.
this.spread = this.effective_spread;
// Key Statistics.
this.stats = async () => await this.handle('/stats');
// Regulation SHO Threshold Securities.
this.threshold_securities = async (date) => await this.handle(`/threshold-securities/${date || ''}`);
// Time Series.
this.time_series = this.chart;
// Today Earnings.
this.today_earnings = async () => await this.handle('/today-earnings');
// Volume By Venue.
this.volume_by_venue = async () => await this.handle('/volume-by-venue');
this.symbol = (symbol || 'market').toLowerCase();
return this;
}
}
exports.stock = stock;
});
}
exports.stock = stock;
//# sourceMappingURL=index.js.map
{
"name": "investors-exchange.api",
"version": "0.1.12",
"version": "0.1.13",
"description": "Unofficial Browser / NodeJS API for https://iextrading.com",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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