Socket
Socket
Sign inDemoInstall

form-urlencoded

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

form-urlencoded

Return an object as an 'x-www-form-urlencoded' string


Version published
Weekly downloads
305K
increased by22.03%
Maintainers
1
Weekly downloads
 
Created

What is form-urlencoded?

The form-urlencoded npm package is used to encode and decode URL-encoded form data. It is particularly useful for working with HTTP requests and responses where data needs to be sent or received in the application/x-www-form-urlencoded format.

What are form-urlencoded's main functionalities?

Encoding an Object to URL-encoded String

This feature allows you to convert a JavaScript object into a URL-encoded string, which is useful for sending data in HTTP POST requests.

const formurlencoded = require('form-urlencoded');
const data = { name: 'John Doe', age: 30, city: 'New York' };
const encoded = formurlencoded(data);
console.log(encoded); // Output: 'name=John%20Doe&age=30&city=New%20York'

Decoding a URL-encoded String to an Object

This feature allows you to convert a URL-encoded string back into a JavaScript object, which is useful for processing data received in HTTP POST requests.

const formurlencoded = require('form-urlencoded');
const encoded = 'name=John%20Doe&age=30&city=New%20York';
const decoded = formurlencoded.parse(encoded);
console.log(decoded); // Output: { name: 'John Doe', age: '30', city: 'New York' }

Other packages similar to form-urlencoded

Keywords

FAQs

Package last updated on 06 Jun 2018

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