Yeah, no... not that pthreads are infeasible on the 3DS, but you do a while(true); and you softlock the entire system, so yeah, no...
And you'd also need to port libuv which is a very thread-heavy library, so it's not going to happen any time soon[emoji769]
Also, Discord bots are already possible on the 3DS [emoji14] You just need to write them in C/C++ instead of JS or CShasp or Python (there is no Discord library for Python 2.7, and Python 3.6 is not yet fully functional) or Java (it uses spinlocks which softlock the entire 3DS, so it's not portable without a major rewrite) or Lua (you'd need to write your own Discord Lua lib in C/C++ because all Discord Lua libs require libuv).
If you'd tell the reason you want NodeJS on the 3DS, I could try suggesting an alternative which is more feasible.