encodeuri-safe
Safely URI encode and decode strings, regardless of how many levels of encoding is present.
Installation
$ npm install encodeuri-safe
Example
var encodeURISafe = ; encodeURISafe; // "foo%20bar%20baz"encodeURISafe; // "foo%20bar%20baz"encodeURISafe; // "foo%20bar%20baz" encodeURISafe; // "foo bar baz"encodeURISafe; // "foo bar baz"encodeURISafe; // "foo bar baz"
API
encodeURIComponent(string)
Returns the string
safely converted to one level of URI encoding.
decodeURIComponent(string)
Returns the string
safely decoded from all levels of URI encoding.