Skip to content

grncdr/pct-encode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pct-encode

Create versions of strings where characters that match a regular expression are percent encoded.

Synopsis

var pctEncode = require("pct-encode");

var encode = pctEncode(/\W/g);

console.log(encode("UTF-8 in your URIs: ✓")); // UTF-8%20in%20your%20URIs%3A%20%E2%9C%93

API

module.exports = function (regexp) -> function encode(string)

Given a regular expression, this returns a function that takes a string and returns a copy with characters that match regexp percent-encoded.

About

Standards compliant percent-encoding

Resources

License

Stars

Watchers

Forks

Packages

No packages published