Elligator based on TweetNaCl
It's certainly possible, although it will be very slow.

TweetNacl includes all the required field arithmetic operations. The main thing you will have to implement is the Chi function.

If you don't understand the internals and how these functions work, I would recommend using libsodium instead. It has a compatible API, and supports hash-to-point using Elligator.