Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 1.24 KB

setGlobalConfig.md

File metadata and controls

46 lines (33 loc) · 1.24 KB

setGlobalConfig

This util function sets global config options, merging with the defaults. These options are then the defaults used for every request. It is the recommended way of setting global config. Setting global config directly is not recommended.

Usage:

import yahooFinance from 'yahoo-finance2';

yahooFinance.setGlobalConfig({
    queue: {
        // some options here
    }
});

Notes:

  • Config provided to this function is validated.
  • Options are merged infinite levels deep:
import yahooFinance from 'yahoo-finance2';

yahooFinance.setGlobalConfig({
    queue: {
        concurrency: 2,
        // timeout is still set
    }
});

Options not documented elsewhere

  • YF_QUERY_HOST

    • Default: query2.yahoo.finance.com

    • Description: the host to use to query Yahoo's API. As per this stackoverflow post:

    • This option in particular may also be set with an environment variable of the same name.