# queryfy

> Utility to create query strings from objects

Latest version **1.1.1** (published 2018-11-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install queryfy
pnpm add queryfy
yarn add queryfy
bun add queryfy
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2018-11-27 |
| First published | 2017-08-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Alexandru Cambose |
| Maintainers | alexcambose |
| Keywords | web, browser, url, uri, encode, decode, param, parameter, request, query, string |

## Links

- npm: https://www.npmjs.com/package/queryfy
- Repository: https://github.com/alexcambose/queryfy
- Homepage: https://github.com/alexcambose/queryfy#readme
- Issues: https://github.com/alexcambose/queryfy/issues
- npm.io page: https://npm.io/package/queryfy

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2018-11-27
- 1.1.0 — 2018-11-27
- 1.0.2 — 2018-01-13
- 1.0.1 — 2017-08-18
- 1.0.0 — 2017-08-16

## README

# queryfy
[![Build Status](https://travis-ci.org/alexcambose/queryfy.svg?branch=master)](https://travis-ci.org/alexcambose/queryfy)
## Install
```
bower install queryfy
```
```html
<script src="bower_components/queryfy/index.js"></script>
```
or
[npm](https://www.npmjs.com/package/queryfy)
```
npm install -S queryfy
```
## Usage

### Standard

```js
const q = require('queryfy');

const params = {
  param1: 'This is param1',
  param2: 'This is param2'
};

const path = 'https://something.com/';

console.log(q.queryfy(path, params));
// https://something.com/?param1=This%20is%20param1&param2=This%20is%20param2
```

or you can specify only the first argument with the query object

```js
const params = {
  param1: 'This is param1',
  param2: 'This is param2'
};
console.log(q.queryfy(params));
// param1=This%20is%20param1&param2=This%20is%20param2
```

### Reversed

```js
const q = require('queryfy');

const path = 'https://something.com/?param1=This%20is%20param1&param2=This%20is%20param2';

console.log(q.deQueryfy(path));
// { param1: 'This is param1', param2: 'This is param2' }
```
it also supports only the query string with or without `?`

```js
console.log(q.deQueryfy('param1=This%20is%20param1&param2=This%20is%20param2'));
// { param1: 'This is param1', param2: 'This is param2' }

console.log(q.deQueryfy('?param1=This%20is%20param1&param2=This%20is%20param2'));
// { param1: 'This is param1', param2: 'This is param2' }
```

---
_Source: https://npm.io/package/queryfy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
