# query-builder-al

> The queryBuilder function is a utility designed to construct and format URL query strings in JavaScript.

Latest version **1.0.6** (published 2023-08-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install query-builder-al
pnpm add query-builder-al
yarn add query-builder-al
bun add query-builder-al
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2023-08-17 |
| First published | 2023-08-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 13.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | aleksandarLazic1998 |
| Maintainers | aleksandar_lazic1998 |
| Keywords | url builder, query maker, javascript, typescript, esm, cjs |

## Links

- npm: https://www.npmjs.com/package/query-builder-al
- Repository: https://github.com/aleksandarLazic1998/query-builder
- Homepage: https://github.com/aleksandarLazic1998/query-builder#readme
- Issues: https://github.com/aleksandarLazic1998/query-builder/issues
- npm.io page: https://npm.io/package/query-builder-al

## Dependencies (2)

- [typescript](https://npm.io/package/typescript.md) ^5.1.6
- [query-builder-al](https://npm.io/package/query-builder-al.md) ^1.0.2

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.6 (latest) — 2023-08-17
- 1.0.5 — 2023-08-13
- 1.0.4 — 2023-08-11
- 1.0.3 — 2023-08-09
- 1.0.2 — 2023-08-08
- 1.0.1 — 2023-08-08
- 1.0.0 — 2023-08-08

## README

# Query Builder: Create URL with Query Parameters

This utility function enables you to construct a complete URL with query parameters based on a given base URL and a query object. It simplifies the process of building URLs with dynamic query parameters for web applications.

## Installation

To use the query builder utility in your project, you can install it via npm:

```bash
npm install query-builder-al
```

Query builder works with both types of modules.

```bash
import queryBuilder from 'query-builder-al';

const query = queryBuilder({
  baseQuery: 'https://www.some-website.com/some-path',
  queryObject: { page: 1, search: 'John Doe', per_page: 15 },
});

console.log(query);
// Output: https://www.some-website.com/some-path?page=1&search=John+Doe&per_page=15

---------------------------------------------

const queryBuilder = require('query-builder-al');

const query = queryBuilder({
  baseQuery: 'https://www.some-website.com/some-path',
  queryObject: { page: 1, search: 'John Doe', per_page: 15 },
});

console.log(query);
// Output: https://www.some-website.com/some-path?page=1&search=John+Doe&per_page=15


---------------------------------------------

const queryBuilder = require('query-builder-al');


// If you do not add value it will just create "&key_name= "

const query = queryBuilder({
  baseQuery: 'https://www.some-website.com/some-path',
  queryObject: { page: 1, search: '', per_page: 15 },
});

console.log(query);
// Output: https://www.some-website.com/some-path?page=1&search=&per_page=15
```

Contributions to this utility are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on the [GitHub repository](https://github.com/aleksandarLazic1998/query-builder).

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