
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
prebuilt-tdlib
Advanced tools
This package distributes pre-built TDLib shared libraries through npm. The libraries are built on GitHub Actions (prebuilt-tdlib.yml) and published using npm publish --provenance.
Supported systems:
To install prebuilt-tdlib
for the latest TDLib version that prebuilt-tdlib
supports, run:
$ npm install prebuilt-tdlib
To install prebuilt-tdlib
for a specific TDLib version instead of latest,
e.g. TDLib v1.8.50, use the td-
dist-tags:
$ npm install prebuilt-tdlib@td-1.8.50
To get the list of available versions, run npm info prebuilt-tdlib dist-tags
1.
The TDLib version is important: there is no backward compatibility and the interface you use may significantly change after an update. It is, though, recommended to use the latest TDLib version.
The shared libraries are statically linked against OpenSSL and zlib (for one, to prevent compatibility issues in Node.js). libstdc++ is also linked statically on Linux.
For the dependencies of TDLib (zlib and openssl), except on Windows, the
nixpkgs-unstable
package repository is used, and the versions of those
dependencies reflect the state of nixpkgs-unstable
at the time of building of
prebuilt-tdlib
.
prebuilt-tdlib
also includes TypeScript types for the appropriate TDLib
version generated via tdl-install-types
(using its latest version at the time
of publishing prebuilt-tdlib
). If you want to override TDLib types, set
skipLibCheck
to true
in your tsconfig.
The prebuilt-tdlib
package exports getTdjson()
, which returns the path to
the tdjson
shared library.
const { getTdjson } = require('prebuilt-tdlib')
console.log(getTdjson())
// Prints a path like:
// '/home/user/proj/node_modules/@prebuilt-tdlib/linux-x64-glibc/libtdjson.so'
This package is primarily meant to be used with tdl. You can pass the
path to tdl.configure
(since tdl v7.3.0):
const tdl = require('tdl')
const { getTdjson } = require('prebuilt-tdlib')
tdl.configure({ tdjson: getTdjson() })
// ...
The pre-built libraries can also be extracted and used with any other library or programming language.
This information is present mostly for maintaining
prebuilt-tdlib
, it is not strictly necessary for using this package.
Because TDLib does not follow SemVer, not to require the users to manually
specify the exact version of prebuilt-tdlib
in their package.json
, the TDLib
version is packed into a single minor version.
prebuilt-tdlib
is published to npm under versions 0.xyyyzzz.v
, where
x
, y
, z
correspond to the x.y.z
TDLib version (e.g., 1.8.0). The
leading zeros are appended to y
and z
(y=8
becomes y=008
).v
corresponds to the version of prebuilt-tdlib
itself, these updates can
contain fixes in case some of the builds were broken or include new pre-built
libraries for other platforms.0
.Example: the npm release for TDLib v1.8.5
is 0.1008005.0
.
For convenience, td-x.y.z
dist-tags are available. To install prebuilt-tdlib
for
TDLib v1.8.5, just run npm install prebuilt-tdlib@td-1.8.5
, or
npm install prebuilt-tdlib@td-1.8.0
for TDLib v1.8.0.
The releases of the prebuilt-tdlib
npm package are not git-tagged.
Additionally, TDLib's releasing process is unusual, and most
prebuilt-tdlib
releases are not connected to any tag release in the TDLib
repository. Usually, the prebuilt packages are generated based on the "Update
version to x.y.z." TDLib commit (example) or, if subsequent
commits have been made before such a commit is pushed to tdlib/td
, on the last
pushed commit. The commit hash is indicated in prebuilt-tdlib's
package.json, see e.g. npm info prebuilt-tdlib tdlib
(or tdlib.commit
).
Changes to the building process of prebuilt-tdlib
are noted below.
First published as prebuilt-tdlib@td-1.8.52
(patch 1).
prebuilt-tdlib
now optionally depends on the @prebuilt-tdlib/types
package, which contains TypeScript types generated via tdl-install-types
for
convenience. They still can be overridden by manually generating
tdlib-types.d.ts
via tdl-install-types
and using skipLibCheck: true
in
tsconfig.getTdlibInfo()
function that returns the commit hash and version of
TDLib.First published as prebuilt-tdlib@td-1.8.40
.
darwin-x64
and darwin-arm64
instead of
using a universal binary.windows-2022
GitHub Actions runner
instead of windows-2019
.First published as prebuilt-tdlib@td-1.8.33
.
The building process is significantly changed in this update.
optionalDependencies
of prebuilt-tdlib
. The
same approach is used by, e.g., esbuild and swc. This installs a binary for
the user's system only, allowing prebuilt-tdlib
to potentially scale for
more architectures and libc variants. One downside is that node_modules
can't simply be copied to a different platform anymore. The prebuilds
directory in the prebuilt-tdlib
package is removed.Fix (2024-07-21): Fixed codesigning on macOS arm64.
First published as prebuilt-tdlib@td-1.8.29
.
tdlib: { commit: ..., version: ... }
field to package.json
. This
allows to query information using npm info prebuilt-tdlib tdlib.commit
, for
example.commit
as an alias for ref
to tdlib.json
.--provenance
.First published as prebuilt-tdlib@td-1.8.19
.
prebuilds/tdlib.json
file specifying the TDLib
commit hash and version.First published as prebuilt-tdlib@td-1.8.14
.
prebuilt-tdlib
should run out of the box on these systems now.Or, with more convenient output, using jq:
$ npm info prebuilt-tdlib dist-tags --json | jq 'to_entries | sort_by(.value) | .[].key | select(startswith("td-"))'
↩
FAQs
Pre-built TDLib libraries
The npm package prebuilt-tdlib receives a total of 1,481 weekly downloads. As such, prebuilt-tdlib popularity was classified as popular.
We found that prebuilt-tdlib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.