encody
v1.0.0
Published
Tagged string helper for encodeURIComponent.
Downloads
6
Maintainers
Readme
encody
Tagged string helper for encodeURIComponent
.
Usage
In cases where you would do:
let url = 'http://example.com/?cat=' + encodeURIComponent('meow') + '&dog=' + encodeURIComponent('woof')
you can just do:
const encody = require('encody')
let url = encody`http://example.com?cat=${meow}&dog=${woof}`
encody(strings, ...vals)
Tag function for template string literals.
Encodes everything in vals
with encodeURIComponent
.
Returns: String
License
MIT