TIMEX TIMEX - 1 year ago 208
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()')
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download