Q:

how to convert arabic content to unicode format in nodejs?

I have arabic content that I need to convert to unicode in node.js. For example دبي, this text should convert to \u062f\u0628\u064a. 
What must I do to achieve this within node.js? Are there any packages which might help?

A:

Try this module - https://github.com/mathiasbynens/jsesc
jsesc('دبي')
'\\u062F\\u0628\\u064A'

This might help you too https://gist.github.com/mathiasbynens/1243213

