Pre-compiled static builds of popular open source libraries for Node.js and Bun
ffilibs provides pre-compiled static versions of popular open source libraries, packaged for easy distribution via npm. This eliminates the need to compile native dependencies from source, making it faster and easier to use powerful libraries like libgit2, libssh2, and others in your JavaScript/TypeScript projects.
- ⚡ Fast Installation: No more waiting for native compilation
- 🔧 Zero Dependencies: Static builds with no external library requirements
- 🌍 Cross-Platform: Support for macOS, Windows, and Linux on both x64 and ARM architectures
- 📦 npm Ready: Simple npm install - no build tools required
- 🦀 Bun Optimized: Works seamlessly with Bun's FFI capabilities
Bun makes it incredibly easy to call into these native libraries:
| libgit2 | 1.9.1 | Git implementation library | @ffilibs/libgit2-beta |
| libssh2 | 1.9.0 | SSH2 lib | @ffilibs/libssh2-beta |
| yogalayout.dev | 3.2.1 | Cross-platform layout engine | @ffilibs/yogalayout.dev-beta |
| macOS | ✅ | ✅ |
| Linux | ✅ | ✅ |
| Windows | ✅ | ❌ |
Each library is built with optimized settings:
- Static linking: No external dependencies
- Release mode: Optimized for performance
- Cross-platform: Built on GitHub Actions for all supported platforms
- Consistent configuration: SSH support enabled where applicable
To build a library locally:
The build script will:
- Download the source code
- Configure with appropriate flags
- Compile with all CPU cores
- Package into release.tar.gz
This project is inspired by a tweet from @thdxr:
"there needs to be a project that provides static builds of common libraries (libgit2, treesitter, yoga, etc) for x64 + ARM + mac/windows/linux and publishes them to npm
bun makes it stupid easy to call into these, it's just the packaging that is annoying"
We welcome contributions! Here's how you can help:
- 🐛 Report Issues: Found a bug? Create an issue
- 📦 Request Libraries: Need another library? Open a feature request
- 🔧 Improve Builds: Help optimize build scripts and configurations
- 📖 Documentation: Help improve docs and examples
- 🎃 Hacktoberfest: This project participates in Hacktoberfest!
- Create a new directory in packages/
- Add build.sh and build.ps1 scripts
- Configure static build with appropriate flags
- Test on all supported platforms
- Submit a pull request
- GitHub: Create an issue or pull request
- X/Twitter: @bascodes
This project is licensed under the MIT License.
Built with ❤️ for the JavaScript and Bun community
.png)


