![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
channel-server
Advanced tools
Social network users who are concerned about privacy and censorship want to run their own decentralized instances, yielding full control over own data. channel-server is a building block for a bright future: it exposes your data to the network, featuring access control and real-time update notification.
The primary network protocol is Buddycloud Channels.
channel-server is distributed under the Apache License 2.0. See the
LICENSE
file.
At this early stage you should be prepared to upgrade this software in the future.
You will need Node and its package manager npm. Then install development packages for installing the required libraries:
apt-get install -t testing libicu-dev libexpat-dev # on Ubuntu/Debian
Next, depending on your preference, you may choose to just
npm install channel-server
or install further dependencies
manually and run channel-server from the repository:
npm install node-xmpp step node-uuid node-stringprep
npm install cradle # for CouchDB
npm install pg # for PostgreSQL
Edit config.js
. It's not just JSON but full JavaScript, meaning you
can use unquoted object keys and even code.
The xmpp
section sets up a component connection. For ejabberd the
listener configuration should look like this:
{5233, ejabberd_service, [{hosts, ["channels.example.com"], [{password, "secret"}]}]}
reduce_limit
to false
The pg library uses TCP
connections, no Unix domain sockets with user account
credentials. Hence, use createuser -P
and grant the new user
privileges on your database.
Next, install the database schema:
psql channel-server
\i postgres.sql
Simply do:
node main.js
The most important concept with Node is asynchronous event handlers. We try to flatten the code flow by using the Step library. Pay attention to always call a callback in success as well as error cases. Lost control flows may result in hanging requests and unfinished database transactions.
Network applications are proxies. In general, they provide a well-defined interface to databases with additional access control, data sanitization, and in this case, notification hooks.
Additionally, the MVC pattern influenced this application much:
xmpp_pubsub.js
controller.js
Implementing new features is easy with CouchDB as developers may change their database schema as they please. Unless you're able to optimize the hell out of it, don't use in production.
Sporting real transactions and a normalized database schema, this SQL backend is expected to yield high performance.
grep TODO *.js
FAQs
buddycloud channels service for XMPP
The npm package channel-server receives a total of 2 weekly downloads. As such, channel-server popularity was classified as not popular.
We found that channel-server demonstrated a not healthy version release cadence and project activity because the last version was released 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.