This package has been deprecated

Author message:

This package is deprecated. Please use @fugle/realtime instead.

fugle
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Fugle API Client

NPM version Build Status Coverage Status

[DEPRECATED] Fugle API client library for JavaScript

Deprecation Notice

This package is deprecated. Please use @fugle/realtime instead.

Install

$ npm install --save fugle

Browser

Add a <script> to your index.html:

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

Node.js / Webpack

Import the module to your *.js file:

const Fugle = require('fugle')

Usage

The library support for REST API and WebSocket.

REST API

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

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

Intraday odd lot trading:

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

WebSocket

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

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

Reference

Fugle API

License

MIT

Package Sidebar

Install

npm i fugle

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

7.17 kB

Total Files

6

Last publish

Collaborators

  • bistin
  • chunkai1312
  • fugle-dev
  • starshine