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

urlencode

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

urlencode

encodeURIComponent with charset

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
157K
decreased by-1.57%
Maintainers
3
Weekly downloads
 
Created

What is urlencode?

The `urlencode` npm package is used for encoding and decoding URL strings. It provides simple methods to encode a string into a URL-safe format and decode a URL-encoded string back to its original format.

What are urlencode's main functionalities?

URL Encoding

This feature allows you to encode a string into a URL-safe format. The `urlencode` function takes a string as input and returns the encoded version of that string.

const urlencode = require('urlencode');
const encoded = urlencode('Hello World!');
console.log(encoded); // Outputs: Hello%20World%21

URL Decoding

This feature allows you to decode a URL-encoded string back to its original format. The `decode` function takes an encoded string as input and returns the decoded version of that string.

const urlencode = require('urlencode');
const decoded = urlencode.decode('Hello%20World%21');
console.log(decoded); // Outputs: Hello World!

Encoding with Character Set

This feature allows you to encode a string using a specific character set. The `urlencode` function can take an additional parameter specifying the character set to use for encoding.

const urlencode = require('urlencode');
const encoded = urlencode('你好', 'gbk');
console.log(encoded); // Outputs: %C4%E3%BA%C3

Decoding with Character Set

This feature allows you to decode a URL-encoded string using a specific character set. The `decode` function can take an additional parameter specifying the character set to use for decoding.

const urlencode = require('urlencode');
const decoded = urlencode.decode('%C4%E3%BA%C3', 'gbk');
console.log(decoded); // Outputs: 你好

Other packages similar to urlencode

Keywords

FAQs

Package last updated on 28 Oct 2023

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