{"id":26042593,"url":"https://github.com/jsweb/params","last_synced_at":"2025-08-12T06:37:55.568Z","repository":{"id":33095739,"uuid":"147040386","full_name":"jsweb/params","owner":"jsweb","description":"Simple JS module to parse/serialize HTTP query/params, useful for Fetch API or AJAX requests","archived":false,"fork":false,"pushed_at":"2022-08-20T21:58:40.000Z","size":325,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-04T02:39:45.016Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-01T23:45:02.000Z","updated_at":"2022-08-18T17:56:12.000Z","dependencies_parsed_at":"2022-06-28T11:31:55.684Z","dependency_job_id":null,"html_url":"https://github.com/jsweb/params","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsweb%2Fparams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsweb%2Fparams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsweb%2Fparams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsweb%2Fparams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsweb","download_url":"https://codeload.github.com/jsweb/params/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241787234,"owners_count":20020096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-07T16:38:44.205Z","updated_at":"2025-03-07T16:38:44.758Z","avatar_url":"https://github.com/jsweb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @jsweb/params\n\nSimple JS module to parse/serialize HTTP query/params. Useful for Fetch API or AJAX requests.\n\nSee tests at [https://params.jsweb.app](https://params.jsweb.app)\n\n![package-npm](https://img.shields.io/badge/package-npm-blue.svg?style=for-the-badge)\n![module-es](https://img.shields.io/badge/module-es-blue.svg?style=for-the-badge)\n![tests-ava](https://img.shields.io/badge/tests-ava-blue.svg?style=for-the-badge)\n\n## New in v4.0.0\n\nNow, its a full ES module, there is no UMD or CommonJS version.\n\nIn modern JS development ES modules are the pattern, already supported in newer versions of Node.js and modern borwsers natively.\n\nBackward compatibility is not a concern here. If you use a module bundler (like Webpack or Rollup) to transpile your code, the result will be compatible according to your setup.\n\n## Instalation\n\nYou can install it using NPM, Yarn or via Unpkg CDN:\n\n`npm i -S @jsweb/params`\n\n`yarn add @jsweb/params`\n\n## Usage\n\n### ES6\n\nTree shaking (since v3.1.0):\n\n```javascript\nimport { serialize, parse, form } from '@jsweb/params'\n```\n\n### From CDN (installation not required)\n\n```html\n\u003cscript type=\"module\"\u003e\n  import { form } from 'https://unpkg.com/@jsweb/params'\n\n  const data = form({ name: 'Lorem Ispum', mail: 'lorem@ipsum' })\n\u003c/script\u003e\n```\n\n## Methods\n\nThere are only 3 methods within **@jsweb/params**:\n\n### serialize(input: object): string\n\nTransform an object to HTTP query string.\n\n```javascript\nimport { serialize } from '@jsweb/params'\n\nconst query = serialize({ a: 1, b: 2, c: 3 }) // returns 'a=1\u0026b=2\u0026c=3'\n```\n\n### parse(input: string): any\n\nTransform an HTTP query string to literal object.\n\n```javascript\nimport { parse } from '@jsweb/params'\n\nconst obj = parse('a=1\u0026b=2\u0026c=3') // { a: 1, b: 2, c: 3 }\n```\n\n### form(input: any): any\n\nTransform query string or object into FormData.\n\nInput can be a query string, object or even an HTMLFormElement.\n\n```javascript\nimport { form } from '@jsweb/params'\n\nconst data1 = form('a=1\u0026b=2\u0026c=3') // FormData instance with fields/values\nconst data2 = form({ a: 1, b: 2, c: 3 }) // FormData instance with fields/values\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsweb%2Fparams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsweb%2Fparams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsweb%2Fparams/lists"}