tdl-tdlib-ffi

Node.js FFI bindings to TDLib

Usage no npm install needed!

<script type="module">
  import tdlTdlibFfi from 'https://cdn.skypack.dev/tdl-tdlib-ffi';
</script>

README

tdl-tdlib-ffi

npm

Node.js FFI bindings to TDLib's libtdjson. Uses node-ffi-napi.

It is meant to be used with the tdl package.

tdl-tdlib-ffi provides TypeScript and Flow typings out of the box.

Installation

$ npm install tdl-tdlib-ffi

API

const { TDLib } = require('tdl-tdlib-ffi')
constructor: new TDLib(libraryFile?: string)

libraryFile's extension can be omitted.

node-ffi will append the extension and pass the library name to dlopen (or LoadLibraryW on Windows).

By default libraryFile is tdjson on Windows and libtdjson on a different OS.

Examples:

new TDLib()
new TDLib('libtdjson')
new TDLib(path.join(__dirname, 'libtdjson'))

For other API see TDLib_API.md in the tdl repository root.