# fugle

> Fugle API client library for JavaScript

Latest version **1.0.0** (published 2021-09-13) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install fugle
pnpm add fugle
yarn add fugle
bun add fugle
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-09-13 |
| First published | 2020-03-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | Chun-Kai Wang |
| Maintainers | bistin, chunkai1312, starshine, fugle-dev |
| Keywords | fugle, stock, realtime, api, ws, websocket, client |

## Links

- npm: https://www.npmjs.com/package/fugle
- Repository: https://github.com/fortuna-intelligence/fugle
- Homepage: https://github.com/fortuna-intelligence/fugle#readme
- Issues: https://github.com/fortuna-intelligence/fugle/issues
- npm.io page: https://npm.io/package/fugle

## Dependencies (4)

- [qs](https://npm.io/package/qs.md) ^6.9.1
- [ws](https://npm.io/package/ws.md) ^7.2.2
- [axios](https://npm.io/package/axios.md) ^0.21.1
- [isomorphic-ws](https://npm.io/package/isomorphic-ws.md) ^4.0.1

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2021-09-13
- 0.2.1 — 2021-06-18
- 0.2.0 — 2020-10-26
- 0.1.0 — 2020-03-08

## README

# Fugle API Client

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

> [DEPRECATED] Fugle API client library for JavaScript

## Deprecation Notice

This package is deprecated. Please use [@fugle/realtime](https://www.npmjs.com/package/@fugle/realtime) instead.

## Install

```sh
$ npm install --save fugle
```

### Browser

Add a `<script>` to your `index.html`:

```html
<script src="/node_modules/fugle/dist/fugle.min.js"></script>
```

### Node.js / Webpack

Import the module to your `*.js` file:

```js
const Fugle = require('fugle')
```

## Usage

The library support for REST API and WebSocket.

### REST API

```js
const fugle = new Fugle({ apiToken: 'demo' })

fugle
  .api('/intraday/quote', { symbolId: '2884' })
  .then(res => console.log(res.data))
```

**Intraday odd lot trading:**

```js
fugle
  .api('/intraday/quote', { symbolId: '2884', oddLot: true })
  .then(res => console.log(res.data))
```

### WebSocket

```js
const fugle = new Fugle({ apiToken: 'demo' })

fugle
  .ws('/intraday/quote', { symbolId: '2884' })
  .onmessage = message => console.log(message.data)
```

## Reference

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

## License

[MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/fugle.svg
[npm-url]: https://npmjs.org/package/fugle
[travis-image]: https://img.shields.io/travis/fortuna-intelligence/fugle-api-client.svg
[travis-url]: https://travis-ci.org/fortuna-intelligence/fugle-api-client
[codecov-image]: https://img.shields.io/codecov/c/github/fortuna-intelligence/fugle-api-client.svg
[codecov-url]: https://codecov.io/gh/fortuna-intelligence/fugle-api-client

---
_Source: https://npm.io/package/fugle · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
