https://github.com/knowledgecode/jquery-param
Equivalent function to jQuery.param
https://github.com/knowledgecode/jquery-param
browser equivalent form-data javascript jquery nodejs param post query-string serialize url-encoding
Last synced: 24 days ago
JSON representation
Equivalent function to jQuery.param
- Host: GitHub
- URL: https://github.com/knowledgecode/jquery-param
- Owner: knowledgecode
- License: mit
- Created: 2015-03-26T15:03:08.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2026-04-06T18:33:44.000Z (about 1 month ago)
- Last Synced: 2026-04-07T05:07:55.617Z (about 1 month ago)
- Topics: browser, equivalent, form-data, javascript, jquery, nodejs, param, post, query-string, serialize, url-encoding
- Language: JavaScript
- Homepage:
- Size: 627 KB
- Stars: 66
- Watchers: 3
- Forks: 16
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jquery-param
[](https://github.com/knowledgecode/jquery-param/actions/workflows/ci.yml)
[](https://www.npmjs.com/package/jquery-param)
## Features
- Equivalent to jQuery.param (based on jQuery 3.x)
- No dependencies
- Universal (Isomorphic)
- ES Modules Support
## Installation
via npm:
```shell
npm i jquery-param
```
## Usage
```javascript
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"
```
CommonJS:
```javascript
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"
```
ES Modules (Browser):
```html
import param from '/path/to/jquery-param.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"
```
Traditional (Browser):
```html
<script>
var obj = { key1: { value1: [10, 20, 30] }, key2: '?a=b&c=d' };
var str = window.param(obj);
// => "key1[value1][]=10&key1[value1][]=20&key1[value1][]=30&key2=?a=b&c=d"
```
## Browser Support
Chrome, Firefox, Safari, Edge, and IE9+.
## License
MIT