TIMEX TIMEX - 4 months ago 44
Javascript Question

How do I URl encode something in Node.js?

I want to URL encode this:

SELECT name FROM user WHERE uid = me()


Do I have to download a module for this? I already have the request module.

Joe Joe
Answer

You can use JavaScript's encodeURIComponent:

encodeURIComponent('select * from table where i()')