open-index/open-npm huggingface dataset:
npm package: @fugle/marketdata
Description: Fugle MarketData API client library for Node.js
Latest version: 1.4.2

# Fugle MarketData

[![NPM version][npm-image]][npm-url]
[![Build Status][action-image]][action-url]
[![Coverage Status][codecov-image]][codecov-url]

> Fugle MarketData API client library for Node.js

## Installation

```sh
$ npm install --save @fugle/marketdata
```

## Importing

```js
// Using Node.js `require()`
const { RestClient, WebSocketClient } = require('@fugle/marketdata');

// Using ES6 imports
import { RestClient, WebSocketClient } from '@fugle/marketdata';
```

## Usage

The library is an isomorphic JavaScript client that supports REST API and WebSocket.

### REST API

```js
const client = new RestClient({ apiKey: 'YOUR_API_KEY' });

const stock = client.stock;   // Stock REST API client
const futopt = client.futopt; // Futures & Options REST API client

stock.intraday.quote({ symbol: '2330' })
  .then(data => console.log(data));
```

### WebSocket API

```js
const client = new WebSocketClient({ apiKey: 'YOUR_API_KEY' });

const stock = client.stock;   // Stock WebSocket API client
const futopt = client.futopt; // Futures & Options WebSocket API client

// open the WebSocket connection and authenticate
stock.connect().then(() => {
  // subscribe the channel to receive streaming data
  stock.subscribe({ channel: 'trades', symbol: '2330' });
});

stock.on('message', (message) => {
  const data = JSON.parse(message);
  console.log(data);
});
```

## License

[MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/@fugle/marketdata.svg
[npm-url]: https://npmjs.com/package/@fugle/marketdata
[action-image]: https://img.shields.io/github/actions/workflow/status/fugle-dev/fugle-marketdata-node/node.js.yml?branch=master
[action-url]: https://github.com/fugle-dev/fugle-marketdata-node/actions/workflows/node.js.yml
[codecov-image]: https://img.shields.io/codecov/c/github/fugle-dev/fugle-marketdata-node.svg
[codecov-url]: https://codecov.io/gh/fugle-dev/fugle-marketdata-node
npm package: @fugle/mcp-server
Description: <!-- ![Docker Pulls](https://img.shields.io/docker/pulls/kevinypfan/fugle-mcp-server) ![Docker Image Size](https://img.shields.io/docker/image-size/kevinypfan/fugle-mcp-server) ![NPM Version](https://img.shields.io/npm/v/fugle-mcp-server) ![NPM Downloads]
Latest version: 0.0.20

# Fugle MCP Server ( 目前僅支援證券功能 )
<!-- ![Docker Pulls](https://img.shields.io/docker/pulls/kevinypfan/fugle-mcp-server)
![Docker Image Size](https://img.shields.io/docker/image-size/kevinypfan/fugle-mcp-server)
![NPM Version](https://img.shields.io/npm/v/fugle-mcp-server)
![NPM Downloads](https://img.shields.io/npm/dm/fugle-mcp-server) -->
<!-- ![License](https://img.shields.io/npm/l/fugle-mcp-server) -->
富果 MCP (Model Context Protocol) 伺服器，用於與富果交易系統進行互動。此伺服器支援股票行情查詢和交易功能。
## 功能特點
- 支援股票即時行情查詢
- 支援歷史數據查詢
- 支援交易功能（可選）
- 支援 Docker 和 NPM 兩種部署方式
- 完全兼容 MCP 協議


## 前置作業

### 安裝 NPM
到 Node.js 官方 [下載](https://nodejs.org/en/download) 對應的作業系統平台

## 申請憑證

### 元富證券請使用 [線上憑證申請](https://ml-fugle-api.masterlink.com.tw/FugleSDK/docs/key/) 或下載 [憑證 e 管家](https://www.masterlink.com.tw/certificate-eoperation) 來申請憑證
⚠️ 使用線上申請憑證之用戶，憑證密碼預設為您的身分證字號

### 富邦證券請下載 [TCEM 憑證管理工具](https://www.fbs.com.tw/Certificate/Management/) 來申請憑證
⚠️ 此工具僅支援 windows 平台，若您使用 Mac or Linux 請先至 Windows 申請完後，再將檔案移轉到 Mac or Lixux 系統上

## 安裝

### 使用 NPM
```bash
npx @fugle/mcp-server
```
### 使用 Docker
```bash
docker pull fugle/mcp-server
```
## 使用方法
### 環境變數
伺服器需要以下環境變數：
- `SDK_TYPE`: MCP Server 使用 SDK 類型（可選：「元富(masterlink)」或「富邦(fubon)」，預設為「元富(masterlink)」）
- `NATIONAL_ID`: 身分證字號
- `ACCOUNT_PASS`: 帳戶密碼
- `CERT_PASS`: 憑證密碼
- `CERT_PATH`: 憑證檔案路徑
- `ENABLE_ORDER`: 是否開啟下單功能（可選，預設為 false）
- `ACCOUNT`: 如有多帳戶，可以使用此參數指定登入帳戶（可選，預設為第一個帳戶）
- `FUBON_URL`: 富邦 SDK 連線 URL（可選，僅適用於 fubon，用於連線測試伺服器）

ℹ️ 元富帳號範例 ： 592a12345678 ( 包含分公司代碼 )  
ℹ️ 富邦帳號範例 ： 1234456 ( 不需包含分公司代碼 )

### Docker 配置

在您的 `.mcp-config.json` 中添加：
```json
{
  "mcpServers": {
    "@fugle/mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "--platform=linux/amd64",
        "-i",
        "--rm",
        "-e",
        "SDK_TYPE",
        "-e",
        "NATIONAL_ID",
        "-e",
        "ACCOUNT_PASS",
        "-e",
        "CERT_PASS",
        "-e",
        "ENABLE_ORDER",
        "-e",
        "ACCOUNT",
        "-e",
        "FUBON_URL",
        "--mount", "type=bind,src=</path/to/cert.p12>,dst=/app/cert.p12",
        "fugle/mcp-server"
      ],
      "env": {
        "SDK_TYPE": "masterlink|fubon",
        "NATIONAL_ID": "您的身分證字號",
        "ACCOUNT_PASS": "您的帳戶密碼",
        "CERT_PASS": "您的憑證密碼",
        "ENABLE_ORDER": "false",
        "ACCOUNT": "指定使用帳戶號碼"
      }
    }
  }
}
```
### NPM 配置
在您的 `.mcp-config.json` 中添加：
```json
{
  "mcpServers": {
    "@fugle/mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@fugle/mcp-server"
      ],
      "env": {
        "SDK_TYPE": "masterlink|fubon",
        "NATIONAL_ID": "您的身分證字號",
        "ACCOUNT_PASS": "您的帳戶密碼",
        "CERT_PASS": "您的憑證密碼",
        "CERT_PATH": "/path/to/your/cert.p12",
        "ENABLE_ORDER": "false",
        "ACCOUNT": "指定使用帳戶號碼"
      }
    }
  }
}
```
npm package: @fugle/realtime
Description: Fugle Realtime API client library for Node.js
Latest version: 0.4.0

# Fugle Realtime

[![NPM version][npm-image]][npm-url]
[![Build Status][action-image]][action-url]
[![Coverage Status][codecov-image]][codecov-url]

> Fugle Realtime API client library for Node.js

## Install

```sh
$ npm install --save @fugle/realtime
```

## Usage

The library is an isomorphic JavaScript client that supports HTTP API and WebSocket.

### HTTP API

```js
import { HttpClient } from '@fugle/realtime';

const client = new HttpClient({ apiToken: 'demo' });
```

#### intraday.meta

```js
client.intraday.meta({ symbolId: '2884' })
  .then(data => console.log(data));
```

#### intraday.quote

```js
client.intraday.quote({ symbolId: '2884' })
  .then(data => console.log(data));
```

#### intraday.chart

```js
client.intraday.chart({ symbolId: '2884' })
  .then(data => console.log(data));
```

#### intraday.dealts

```js
client.intraday.dealts({ symbolId: '2884', limit: 50 })
  .then(data => console.log(data));
```

#### intraday.volumes

```js
client.intraday.volumes({ symbolId: '2884' })
  .then(data => console.log(data));
```

#### historical.candles

```js
client.historical.candles({ symbolId: '2884', from: '2022-02-07', to: '2022-02-11' })
  .then(data => console.log(data));
``` 

### WebSocket

```js
import { WebSocketClient } from '@fugle/realtime';

const client = new WebSocketClient({ apiToken: 'demo' });
```

#### intraday.meta

```js
client.intraday.meta({ symbolId: '2884' })
  .onmessage = message => console.log(JSON.parse(message.data));
```

#### intraday.quote

```js
client.intraday.quote({ symbolId: '2884' })
  .onmessage = message => console.log(JSON.parse(message.data));
```

#### intraday.chart

```js
client.intraday.chart({ symbolId: '2884' })
  .onmessage = message => console.log(JSON.parse(message.data));
```

## Reference

[Fugle Realtime API](https://developer.fugle.tw)

## License

[MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/@fugle/realtime.svg
[npm-url]: https://npmjs.com/package/@fugle/realtime
[action-image]: https://img.shields.io/github/workflow/status/fugle-dev/fugle-realtime-node/Node.js%20CI
[action-url]: https://github.com/fugle-dev/fugle-realtime-node/actions/workflows/node.js.yml
[codecov-image]: https://img.shields.io/codecov/c/github/fugle-dev/fugle-realtime-node.svg
[codecov-url]: https://codecov.io/gh/fugle-dev/fugle-realtime-node
npm package: @fuglu/create-react-component
Description: Create React components easily
Author: Benjamin Kluck
Latest version: 1.0.1

# Create React Component [![Build Status](https://travis-ci.org/fuglu/create-react-component.svg?branch=master)](https://travis-ci.org/fuglu/create-react-component)

Create React components easily.

## Quick Overview

```sh
npm install -g @fuglu/create-react-component

create-react-component my-component
cd my-component/
editor
```

## Getting Started

### Installation

Install it once globally:

```sh
npm install -g @fuglu/create-react-component
```

Or use it in your multi-package repository (sometimes called monorepo):

```sh
npm install --save @fuglu/create-react-component
```
```json
{
  "name": "monorepo",
  "version": "1.0.0",
  "scripts": {
    "create": "create-react-component --base-path packages/ --template-path template/ --",
  },
  "dependencies": {
    "@fuglu/create-react-component": "^1.0.0"
  }
}
```

### Creating a component

To create a new component, run:

```sh
create-react-component my-react-component
```

It will create a directory called `my-react-component` inside the current folder.<br>
Inside that directory, it will generate the initial component structure and install the transitive dependencies:

```
my-react-component/
  node_modules/
  package.json
  src/
    index.js
```

### Custom templates

You **don’t** have to use the provided templates.<br>
Just provide your own template directory and you are ready to go:

```sh
create-react-component my-react-component --template-path my/template/directory
```

The template directory will be used to create the new component and must contain a `package.json`.<br>
You can pass relative and absolute paths to `--template-path`.

### Custom installation directory

You can specify a custom installation directory using relative or absolute paths:

```sh
create-react-component my-react-component --base-path path/to/components
```

### Scoped packages

You might want to add a scope to your package:

```sh
create-react-component my-react-component --scope org
```

This will set the name attribute to `@org/my-react-component` in `package.json`.

# Contributing

We'd love to have your helping hand on `create-react-component`!

## Some Ideas

* :bulb: `--template-package` - Allow the usage of published templates.
* :bulb: Extract `create-react-component-template` and use the published package.
* :bulb: Use [lerna](https://github.com/lerna/lerna) to release `create-react-component` and publish changelogs.
* :bomb: We need some proper end to end tests! Seriously!

# Acknowledgements

We are grateful to the authors of [Create React App](https://github.com/facebookincubator/create-react-app).
npm package: @fuglu/redux-implicit-oauth2
Description: OAuth 2.0 Implicit Grant Flow with Redux
Author: Danilo Bürger
Latest version: 1.0.4

# redux-implicit-oauth2

[OAuth 2.0 Implicit Grant Flow](https://tools.ietf.org/html/rfc6749#section-4.2) with [Redux](https://github.com/reactjs/redux).

## Example (with React)

The following example displays either a login or logout button depending on the state.
Set the config object according to your OAuth 2.0 server parameters.
The redirect callback page should be on the same site as the rest of your app.

```jsx
import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { login, logout } from 'redux-implicit-oauth2'

const config = {
  url: "https://example.com/authorize",
  client: "some_client_id",
  redirect: "https://example.com/callback.html",
  scope: "some_scope"
}

const Login = ({ isLoggedIn, login, logout }) => {
  if (isLoggedIn) {
    return <button type='button' onClick={logout}>Logout</button>
  } else {
    return <button type='button' onClick={login}>Login</button>
  }
}

Login.propTypes = {
  isLoggedIn: PropTypes.bool.isRequired,
  login: PropTypes.func.isRequired,
  logout: PropTypes.func.isRequired
}

const mapStateToProps = ({ auth }) => ({
  isLoggedIn: auth.isLoggedIn
})

const mapDispatchToProps = {
  login: () => login(config),
  logout
}

export default connect(mapStateToProps, mapDispatchToProps)(Login)
```

Don't forget to add the reducer and middleware to your Redux store:

```js
import { createStore, combineReducers, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
import { authMiddleware, authReducer as auth } from 'redux-implicit-oauth2'

const configureStore = (initialState) =>
  createStore(
    combineReducers({
      // other reducers
      auth
    }),
    initialState,
    applyMiddleware(
      // other middleware
      thunk,
      authMiddleware
    )
  )

export default configureStore
```
npm package: @fugood/dns-sd-linux-arm64-gnu
Description: Prebuilt binary package for `dns-sd` on `linux-arm64-gnu`.
Author: Hans
Latest version: 0.1.0-alpha.1

# `@fugood/dns-sd-linux-arm64-gnu`

Prebuilt binary package for `@fugood/dns-sd` on `linux-arm64-gnu`.
npm package: @fugood/dns-sd-linux-x64-gnu
Description: Prebuilt binary package for `dns-sd` on `linux-x64-gnu`.
Author: Hans
Latest version: 0.1.0-alpha.1

# `@fugood/dns-sd-linux-x64-gnu`

Prebuilt binary package for `@fugood/dns-sd` on `linux-x64-gnu`.
npm package: @fugood/dns-sd-win32-arm64-msvc
Description: Prebuilt binary package for `dns-sd` on `win32-arm64-msvc`.
Author: Hans
Latest version: 0.1.0-alpha.1

# `@fugood/dns-sd-win32-arm64-msvc`

Prebuilt binary package for `@fugood/dns-sd` on `win32-arm64-msvc`.
npm package: @fugood/dns-sd-win32-x64-msvc
Description: Prebuilt binary package for `dns-sd` on `win32-x64-msvc`.
Author: Hans
Latest version: 0.1.0-alpha.1

# `@fugood/dns-sd-win32-x64-msvc`

Prebuilt binary package for `@fugood/dns-sd` on `win32-x64-msvc`.
npm package: @fugood/image-mosaic
Description: Creates an image mosaic, this package was forked from [`react-image-mosaic`](https://github.com/thejsn/react-image-mosaic) and used [`node-canvas`](https://github.com/Automattic/node-canvas).
Latest version: 1.0.1

# @fugood/image-mosaic [![Build Status](https://travis-ci.org/mybigday/image-mosaic.svg?branch=master)](https://travis-ci.org/mybigday/image-mosaic) [![NPM version](http://img.shields.io/npm/v/@fugood/image-mosaic.svg?style=flat)](https://www.npmjs.com/package/@fugood/image-mosaic)

Creates an image mosaic,
this package was forked from [`react-image-mosaic`](https://github.com/thejsn/react-image-mosaic) and used [`node-canvas`](https://github.com/Automattic/node-canvas).

## Installation

```bash
$ yarn add @fugood/image-mosaic
```

## Usage

See the [test](src/__tests__/index.spec.js) as usage, you can also refer to [the test fixtures](src/__tests__/) and [image snapshots](src/__tests__/__image_snapshots__).

```js
import mosaic from '@fugood/image-mosaic'

mosaic({
  // The width of the canvas.
  width: 400,
  // The height of the canvas.
  height: 400,
  // The number of columns of images in the mosaic.
  columns: 40,
  // The number of rows of images in the mosaic.
  rows: 40,
  // The amount of blending between each image and its matching color. A number between 0 and 1.
  colorBlending: 0.8,
  // The target image to recreate. Can be a string or an image, the string is assumed to be a url to an image. Expected file buffer.
  target: fs.readFileSync('path/to/image'),
  // An array with urls to images to be used to build the mosaic.
  sources: [
    fs.readFileSync('path/to/image1'),
    fs.readFileSync('path/to/image2'),
  ],
}).then(canvas => {
  const result = canvas.toBuffer()
})
```

See the documentation of [`node-canvas`](https://github.com/Automattic/node-canvas#canvaspngstreamoptions) for more output methods.

## License

[MIT](LICENSE.md)