# qaxt

> The modern JavaScript module that makes writing code quciker and easier!

Latest version **2.0.3** (published 2022-06-06) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2022-06-06 |
| First published | 2022-05-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 47.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | qaxt |
| Maintainers | qaxt |
| Keywords | array, math, lodash, filter, quxt, quxapp |

## Links

- npm: https://www.npmjs.com/package/qaxt
- Repository: https://github.com/qaxt/js
- Homepage: https://github.com/qaxt
- Issues: https://github.com/qaxt/js/issues
- npm.io page: https://npm.io/package/qaxt

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 2.0.3 (latest) — 2022-06-06
- 2.0.2 — 2022-06-06
- 2.0.1 — 2022-06-06
- 2.0.0 — 2022-06-05
- 1.1.0 — 2022-05-29
- 1.0.0 — 2022-05-10

## README

# Qaxt
The modern JavaScript module that makes writing code quciker and easier! Qaxt is aimed to be more lightweight and useful than my original project [Quxt](https://npmjs.com/package/quxt)

## Installation
```sh
npm install qaxt
```

```sh
yarn add qaxt
```

## Quick Start
Here is a quick template to get started!
### CJS
```js
const _ = require('qaxt')
```
### ESM
```js
import _ from 'qaxt'
```

## Example
Here is a **small** snippet to test the module!
```js
var result = null

for (let i of _.range(0, 10, 2)) {
  console.log(i)
}

for (let i of _.range(10, 0)) {
  console.log(i)
}

const users = [
  {
    name: 'foo',
    age: 8,
    deleted: false,
  },
  {
    name: 'bar',
    age: 18,
    deleted: false,
  },
  {
    name: 'baz',
    age: 13,
    deleted: true,
  },
  {
    name: 'qux',
    age: 13,
    deleted: false,
  },
]

// Gets objects with the same key & value pairs
result = users.filter(_.matches({ name: 'foo' }))
console.log(result)

// Gets objects where a key is equal to a value
result = users.filter(_.matchesProperty(['age', 13]))
console.log(result)

// Gets objects with truthy deleted values
result = users.filter(_.property('deleted'))
console.log(result)

// Gets objects with key & value pairs with an expression
result = users.filter(_.must({ age: `>= 13` }))
console.log(result) // 13+ year olds

// Like before but takes multiple expressions
result = users.filter(_.must({ age: ['||', '=== 18', '=== 8'] }))
console.log(result) // must be 18 or 8 years old

/* Returns list of [0] matched values [1] other values */

// Partition with function rule
result = _.partition(users, _.must({ name: `[0] === 'b'` }))
console.log(result) 

// The matches() shorthand
result = _.partition(users, { age: 13 })
console.log(result)

// The matchesProperty() shorthand
result = _.partition(users, ['name', 'qux'])
console.log(result)

// The property() shorthand
result = _.partition(users, 'deleted')
console.log(result)

/* OR, NOT, AND, XOR operations on arrays */

const one = ['foo', 'bar', 'baz']
const two = ['bar', 'baz']
const three = ['baz', 'qux']

// Unites multiple arrays
result = _.unite(one, two, three)
console.log(result)

// Subtracts an array from another
result = _.subtract(one, two, three)
console.log(result)

// Returns the common elements in arrays
result = _.intersect(one, two, three)
console.log(result)

// Gets the symmetric difference
result = _.exclude(one, two, three)
console.log(result)

/* Stastics and Data */

const companies = ['google', 'amazon', 'microsoft', 'google', 'apple', 'amazon', 'netflix']

result = _.frequency(companies)
console.log(result)

result = _.mode(companies)
console.log(result)

/* Maths */

// Returns true if the number is prime
console.log(_.prime(7))

// Gets the highest common factor of multiple integers
console.log(_.hcf(24, 51, 18))

// Same as hcf() but only takes 2 integers recursively
console.log(_.gcd(138, 207))

// Gets the factors of a number in pairs
console.log(_.factors(144))

// Sorting
result = _.quickSort(_.factors(144))
console.log(result)

result = _.shellSort(_.factors(128))
console.log(result)

/* Array Management */

// Zip
result = _.zip(['username', 'pasword'], ['foo', 'bar'], ['baz', 'qux'])
console.log(result)
```

## Major Updates
- Added `intersectBy` and `excludeBy`
- Added `simul` for iterating multiple lists
- Added `equal` that works for lists and objects

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