TIMEX TIMEX - 1 year ago 139
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 Source

You can use JavaScript's encodeURIComponent:

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