# array-simple-query

> A convenient lib to manipulate objects in JavaScript arrays.

Latest version **0.1.2** (published 2023-08-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install array-simple-query
pnpm add array-simple-query
yarn add array-simple-query
bun add array-simple-query
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2023-08-27 |
| First published | 2022-06-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 45.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Carlos Viol Barbosa |
| Maintainers | cviolbarbosa |
| Keywords | database, lodash, query, store |

## Links

- npm: https://www.npmjs.com/package/array-simple-query
- Repository: https://github.com/FraunhoferIVI/helyOS-javascript-sdk
- Homepage: https://github.com/FraunhoferIVI/helyOS-javascript-sdk#readme
- Issues: https://github.com/FraunhoferIVI/helyOS-javascript-sdk/issues
- npm.io page: https://npm.io/package/array-simple-query

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2023-08-27
- 0.1.1 — 2023-08-27
- 0.1.0 — 2022-06-02
- 0.0.1 — 2022-06-02

## README

<div id="top"></div>



<!-- PROJECT LOGO -->
<br />
<div align="center">
  <!-- <a href="https://github.com/">
    <img src="helyos_logo.png" alt="Logo"  height="80">
  </a> -->

  <h3 align="center">Array Simple Query</h3>

  <p align="center">
    A convenient lib to manipulate object in JavaScript arrays.
    <br />
    <a href="https://cviolbarbosa.github.io/array-simple-query/"><strong>Explore the docs »</strong></a>
    <br />
    <br />
    <a href="https://github.com/">View Demo</a>
    ·
    <a href="https://github.com/cviolbarbosa/array-simple-query/issues">Report Bug</a>
    ·
    <a href="https://github.com/cviolbarbosa/array-simple-query/issues">Request Feature</a>
  </p>
</div>

## About The Project

Convenient functions to query and change objects in a JavaScript array. It is useful to manipulate local storages mirroring a server database.


### List of features
*   Get and object using queries.
*   Filter array objects using nested queries.
*   Use queries to delete and update objects inside the array.

## Getting Started

### Installation

```shell 
$ npm i array-simple-query  --save
```

### Usage

```js 

import * as ASQ from 'array-simple-query';

const books = [{ 'id': 1, 'title': 'English course', 'author': {first_name: 'Joe', last_name:'Doe'},       'year': 2009 },
            { 'id': 2, 'title': 'Italian course', 'author': {first_name: 'Pinco', last_name:'Pallino'}, 'year': 2010 },
            { 'id': 3, 'title': 'German course', 'author': {first_name: 'Max', last_name:'Musterman'}, 'year': 2009 },
            { 'id': 4, 'title': 'Portugues course', 'author': {first_name: 'Ciclano', last_name:'Silva'}, 'year': 2010 }];

// simple query
const englishBook =  ASQ.getObject(books, {'title':'English course'});

//nested query
const pallinosBook = ASQ.getObject(books, {'author.last_name':'Pallino'});

//negation
const nonGermanBooks = ASQ.filterObjects(books,{'!title': 'German course'});

//deletion
const positionOfDeletedElements = ASQ.deleteObjects(books, {'year': 2009});
```


### Contributing
This package is in development. 
### Authors 
*   Carlos E. Viol Barbosa


### License

This project is licensed under the MIT License

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