@winner-fed/quote-jsapi
v1.0.1-beta.5
Published
Market http analysis library by winner.
Downloads
4
Readme
Quote HTTP JSAPI
Install package programmatically. Detect package managers automatically (npm
, yarn
and pnpm
).
npm i axios
npm i @winner-fed/quote-jsapi
使用
Webpack or Vite(CJS/ESM)
import OpenAPI from '@winner-fed/quote-jsapi';
// 初始化
const openAPI = new OpenAPI({
// 获取行情 token 的服务接口地址
tokenUrl: 'https://xxxx/getToken',
// 获取行情相关服务接口地址
openUrl: 'https://open.hs.net',
// 直接传入 token
token: ''
// tokenUrl和token只输入其一即可
});
// 调用
openAPI.getMarketHoliday({ finance_mic: 'XHKG-M', date: '2023' });
浏览器(IIFE)
<script src="https://unpkg.com/@winner-fed/quote-jsapi/dist/index.global.js"></script>
<script>
// 初始化
const openAPI = new window.jQuote.OpenAPI({
// 获取行情 token 的服务接口地址
tokenUrl: 'https://xxxx/getToken',
// 获取行情相关服务接口地址
openUrl: 'https://open.hs.net',
// 直接传入 token
token: ''
// tokenUrl和token只输入其一即可
});
// 调用
openAPI.getMarketHoliday({ finance_mic: 'XHKG-M', date: '2023' });
</script>
目录结构
.
├── index.d.ts # 声明文件
├── index.global.js # iife
├── index.js # esm
└── index.cjs # cjs