diff --git a/bin/yahoo-finance.js b/bin/yahoo-finance.js index a280cf71..4e028fa0 100755 --- a/bin/yahoo-finance.js +++ b/bin/yahoo-finance.js @@ -1,8 +1,7 @@ #!/usr/bin/env node -const YahooFinance = require('../api/index.js').default; -const { modules } = require('../api/index.js'); -const moduleNames = Object.keys(modules); +const yahooFinance = require('../api/index.js'); +const moduleNames = Object.keys(yahooFinance); const node = process.argv[0]; const script = process.argv[1]; @@ -31,7 +30,6 @@ function decodeArgs(stringArgs) { (async function() { const args = decodeArgs(argsAsStrings); - const yahooFinance = new YahooFinance(); const result = await yahooFinance[moduleName](...args); if (process.stdout.isTTY) diff --git a/src/index.ts b/src/index.ts index 0f047cc1..90034e37 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,22 +3,9 @@ import historical from './modules/historical'; import quoteSummary from './modules/quoteSummary'; import search from './modules/search'; -export const modules = { +export { autoc, historical, quoteSummary, search, }; - - -class YahooFinance { - constructor() { - } - - autoc = autoc; - historical = historical; - quoteSummary = quoteSummary; - search = search; -} - -export default YahooFinance;