pct-encode

1.0.3 • Public • Published

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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.3103,043latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.3103,043
1.0.223,712
1.0.13
1.0.04

Package Sidebar

Install

npm i pct-encode

Weekly Downloads

101,295

Version

1.0.3

License

BSD-2-Clause

Unpacked Size

3.37 kB

Total Files

7

Last publish

Collaborators

  • grncdr