Skip to content

bitfinexcom/bfx-hf-models-adapter-lowdb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bitfinex Honey Framework LowDB Adapter for Node.JS

This is an adapter around lowdb (a lodash-powered JSON database) for the Bitfinex Honey Framework. To use, initialize an instance of the bfx-hf-models database with it as an adapter.

Features

  • lowdb saves the DB contents as a JSON file on disk
  • No need to run a 3rd party database server instance
  • Fully compatible with bfx-hf-models & the HF system (bfx-hf-data-server, bfx-hf-algo-server, bfx-hf-algo, etc)

Installation

npm i --save bfx-hf-models-adapter-lowdb

Quickstart & Example

const HFDBLowDBAdapter = require('bfx-hf-models-adapter-lowdb')
const { schema: HFDBBitfinexSchema } = require('bfx-hf-ext-plugin-bitfinex')
const HFDB = require('bfx-hf-models')

const LOWDB_FILENAME = '...'

const db = new HFDB({
  schema: HFDBBitfinexSchema,
  adapter: HFDBLowDBAdapter({
    dbPath: LOWDB_FILENAME,
    schema: HFDBBitfinexSchema,
  }),
})

const { Candle } = db
const candles = await Candle.getAll()

console.log(`read ${candles.length} candles`)

Docs

Refer to the examples/ folder for executable examples. For information on the available model methods, check the documentation for bfx-hf-models

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Note

This package will be maintained only via github, please use latest relases from github instead of npm.

Example on how to install specific version from github:

npm i --save-prod https://github.com/bitfinexcom/bfx-hf-models-adapter-lowdb.git#v1.0.3

Example on how to install it latest version from github:

npm i --save-prod https://github.com/bitfinexcom/bfx-hf-models-adapter-lowdb.git

About

LowDB adapter for the Honey Framework database

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%