gadicc / node-yahoo-finance2

Unofficial API for Yahoo Finance
https://www.npmjs.com/package/yahoo-finance2
MIT License
353 stars 58 forks source link

No way to import `ExtendedCookieJar` #761

Closed gera2ld closed 2 months ago

gera2ld commented 2 months ago

Bug Report

According to the docs, we can set a ExtendedCookieJar to persist the cookies. However, there is no way to import ExtendedCookieJar because it is not properly exported.

Describe the bug

There is no way to import ExtendedCookieJar because it is not properly exported in package.json or ./dist/esm/src/index-node.js.

Minimal Reproduction

import { ExtendedCookieJar } from 'yahoo-finance2/dist/esm/src/lib/cookieJar.js';

console.log(ExtendedCookieJar);

Get error: ERR_PACKAGE_PATH_NOT_EXPORTED

Environment

Browser or Node: Node Node version (if applicable): 21.7.1 Npm version: 10.5.0 Browser verion (if applicable): Library version (e.g. 1.10.1): 2.11.0

Additional Context

gadicc commented 2 months ago

Right you are, @gera2ld; thanks for reporting.

This has been fixed and will be in the next release; there will be an automated message here when that happens.

You can also now import directly from the package root, i.e., in your index.mjs example above:

import { ExtendedCookieJar } from 'yahoo-finance2'

console.log(ExtendedCookieJar); // works now

Thanks again.

gadicc commented 2 months ago

:tada: This issue has been resolved in version 2.11.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: