npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@jcbit/bitfinex-api-node

v7.2.2

Published

Node reference library for Bitfinex API - Modernized Fork

Readme

@jcbit/bitfinex-api-node

Modernized fork of the official Bitfinex API Node.js library with updated dependencies, Node.js 20+ support, and enhanced development experience.

npm version Node.js License

🚀 What's New in v7.1.0

Modernization Features

  • Node.js 20+ minimum requirement
  • All 47 dependencies updated to latest versions
  • Enhanced npm scripts for better development experience
  • Comprehensive .env configuration system
  • Complete technical documentation and improvement roadmap

🔧 Key Improvements

  • Fixed critical ws v8+ compatibility issue
  • Improved WebSocket message handling
  • Better error handling and debugging
  • Zero linting errors with updated standards
  • 228 tests passing with enhanced validation

📚 Enhanced Documentation

  • TECHNICAL-REVIEW.md - Complete code analysis
  • IMPROVEMENT-PROPOSALS.md - Future enhancement roadmap
  • ENV-SETUP.md - Configuration guide
  • MODERNIZATION.md - Detailed changelog

📦 Installation

GitHub Package Registry

# Configure npm to use GitHub Package Registry for @jcbit scope
echo "@jcbit:registry=https://npm.pkg.github.com" >> ~/.npmrc

# Install the package
npm install @jcbit/bitfinex-api-node

Requirements

  • Node.js: ≥20.0.0
  • npm: ≥10.0.0

🔧 Quick Start

const { BFX } = require("@jcbit/bitfinex-api-node");

// REST API
const bfx = new BFX({
  apiKey: process.env.API_KEY,
  apiSecret: process.env.API_SECRET,
  transform: true,
});

const rest = bfx.rest(2);

// Get ticker
rest.ticker("tBTCUSD").then((ticker) => {
  console.log("BTC/USD:", ticker);
});

// WebSocket API
const ws = bfx.ws(2);

ws.on("open", () => {
  console.log("Connected to Bitfinex WebSocket");
  ws.subscribeTicker("tBTCUSD");
});

ws.onTicker({ symbol: "tBTCUSD" }, (ticker) => {
  console.log("Ticker update:", ticker);
});

ws.open();

🔐 Configuration

Create a .env file in your project root:

# Copy the example configuration
cp node_modules/@jcbit/bitfinex-api-node/.env.example .env

# Edit with your credentials
API_KEY=your_api_key_here
API_SECRET=your_api_secret_here

See ENV-SETUP.md for complete configuration options.

🆚 Differences from Original

This is a modernized fork of the official bitfinex-api-node with:

| Feature | Original | This Fork | | ----------------- | ----------- | --------------------- | | Node.js | ≥16.0.0 | ≥20.0.0 | | Dependencies | Outdated | All updated (47 deps) | | ws Library | v7 (broken) | v8+ (fixed) | | Configuration | Manual | .env + guide | | Documentation | Basic | Comprehensive | | Development | Limited | Enhanced scripts | | Testing | Basic | Validated + examples |

📋 Available Scripts

# Development
npm run dev          # Start with nodemon
npm run test:watch   # Run tests in watch mode

# Testing
npm test            # Run linter + tests
npm run unit        # Run unit tests only
npm run lint        # Run linter
npm run lint:fix    # Fix linting issues

# Documentation
npm run docs        # Generate JSDoc documentation
npm run docs:serve  # Serve docs on localhost:8080

# Maintenance
npm run clean       # Clean node_modules
npm run fresh-install # Clean install

🔗 API Reference

This package maintains 100% compatibility with the original Bitfinex API. All methods, events, and functionality work exactly the same.

REST API

  • Account management (wallets, positions, orders)
  • Market data (tickers, trades, order books)
  • Trading operations (submit, cancel, modify orders)
  • Funding (loans, credits, offers)

WebSocket API

  • Real-time market data
  • Account updates
  • Order management
  • Custom calculations

For detailed API documentation, see the official Bitfinex docs.

🧪 Validation

All functionality has been thoroughly tested:

  • 228 unit tests passing
  • All REST endpoints verified
  • WebSocket connections validated
  • Public examples tested
  • Authenticated examples verified with real API keys
  • Zero linting errors

🚧 Future Roadmap

See IMPROVEMENT-PROPOSALS.md for detailed enhancement plans:

  • TypeScript migration for better DX
  • Smart reconnection with exponential backoff
  • Enhanced error handling with typed errors
  • Connection pooling for REST optimization
  • Debug dashboard for real-time monitoring
  • CLI tools for development and testing

🤝 Contributing

This is a personal fork focused on modernization. For issues with the core API functionality, please refer to the official repository.

For modernization-specific issues or suggestions:

  1. Check existing issues
  2. Create a new issue with detailed description
  3. PRs welcome for bug fixes and improvements

📄 License

MIT License - see LICENSE.md

🙏 Credits

  • Original Library: Bitfinex Team
  • Modernization: JC
  • All Contributors: See package.json contributors list

⚠️ Disclaimer: This is an unofficial modernized fork. For production use, consider the maintenance implications and evaluate whether the original library meets your needs.

🔗 Links: