Socket
Socket
Sign inDemoInstall

jquery-param

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery-param

equivalent function to jQuery.param


Version published
Weekly downloads
31K
decreased by-7.01%
Maintainers
1
Weekly downloads
 
Created
Source

jquery-param

Circle CI

Features

  • Equivalent to jQuery.param (based on jQuery 3.x)
  • No dependencies
  • Universal (Isomorphic)
  • ES Modules Support

Installation

Node.js:

npm install jquery-param --save

the browser:

<script src="/path/to/jquery-param.min.js"></script>

Usage

CommonJS:

const param = require('jquery-param');

const obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' };
const str = param(obj);
// => "key1[value1][]=10&key1[value1][]=20&key1[value1][]=30&key2=?a=b&c=d"

TypeScript:

import param from 'jquery-param';

const obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' };
const str = param(obj);
// => "key1[value1][]=10&key1[value1][]=20&key1[value1][]=30&key2=?a=b&c=d"

You will need to add "esModuleInterop": true to the "compilerOptions" field in tsconfig.json.

ES Modules:

<script type="module">
import param from './esm/jquery-param.es.js';

const obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' };
const str = param(obj);
// => "key1[value1][]=10&key1[value1][]=20&key1[value1][]=30&key2=?a=b&c=d"
</script>

Older browser:

<script>
var obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' };
var str = window.param(obj);    // global object
// => "key1[value1][]=10&key1[value1][]=20&key1[value1][]=30&key2=?a=b&c=d"
</script>

Browser Support

Chrome, Firefox, Safari, Edge, and IE9+.

License

MIT

Keywords

FAQs

Package last updated on 13 Apr 2021

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