Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pct-encode

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pct-encode

Percent-encode characters in strings matching a regular expression

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
92K
decreased by-2.68%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 13 May 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc