Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
This branch is 58 commits ahead of saneki-discontinued:master.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

js-toxcore-c Build Status NPM Version


Node.js bindings for libtoxcore, built off of node-ffi.

Note: Installing this package does not install libtoxcore. It is expected that libtoxcore is installed prior to using js-toxcore-c.

If you see compiler errors while trying to npm install js-toxcore-c, you may need to install node-ffi manually using npm:

$ npm install

New API Progress

  • toxcore (missing conferences)
  • toxav
  • toxencryptsave
  • Higher level API

Synchronous Example

var toxcore = require('js-toxcore-c');

// Create a default Tox instance
var tox = new toxcore.Tox();

// ... or, create a Tox instance using specific paths for toxcore libraries
var toxAtPath = new toxcore.Tox({
  path: '/path/to/',
  crypto: '/path/to/'

// ... or, give Tox some data to load
var toxWithData = new toxcore.Tox({
  data: '/path/to/toxfile'

// ... if that data is encrypted, include a passphrase
var toxWithEncData = new toxcore.Tox({
  data: '/path/to/encrypted/toxfile',
  pass: 'myPassphrase'

// Bootstrap from nodes (see a list at:
tox.bootstrapSync('', 33445, 'A09162D68618E742FFBCA1C2C70385E6679604B2D80EA6E84AD0996A1AC8A074'); // stal
tox.bootstrapSync('', 443, '8CD087E31C67568103E8C2A28653337E90E6B8EDA0D765D57C6B5172B4F1F04C'); // Jfreegman

// Set your name and status message
tox.setNameSync('My username');
tox.setStatusMessageSync('Hello world!');

// Listen for friend requests
tox.on('friendRequest', function(e) {
  console.log('Friend request from: ' + e.publicKeyHex());

// Print received friend messages to console
tox.on('friendMessage', function(e) {
  var friendName = tox.getFriendNameSync(e.friend());
  console.log(friendName + ': ' + e.message());

// Print out your tox address so others can add it
console.log('Address: ' + tox.getAddressHexSync());

// Start!

For more examples, see the examples/ directory.


Generating the documentation should be as easy as grunt jsdoc.


No packages published


  • JavaScript 99.4%
  • Other 0.6%