You can create a SimpleX Chat chat-bot with 17 lines of JS code using the new Node.js library

Beta version: https://npmjs.com/package/simplex-chat/v/6.5.0-beta.4.4

Source code: https://github.com/simplex-chat/simplex-chat/tree/master/packages/simplex-chat-nodejs

To run this example with Node.js:

npm i simplex-chat@6.5.0-beta.4.4

node ./node_modules/simplex-chat/examples/squaring-bot-readme.js

Reply to this note

Please Login to reply.

Discussion

15 lines*

Fun fact: The IIFE is no longer necessary as top-level `await` was introduced in the ES2022 spec 🙂

Right :) But it requires marking the file as mjs or something.

You can say there are like 3 actual lines of code, the rest is boilerplate :)

Que magnífico.