Socket
Socket
Sign inDemoInstall

pct-encode

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pct-encode

Percent-encode characters in strings matching a regular expression


Version published
Weekly downloads
83K
increased by0.94%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 13 May 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc