# Getting Started

## Installation

You can use the 1loc library in any Javascript application (preferably a node.js environment). Vue, React, Angular, Node.js.&#x20;

* Node.js (>= 14 preferably)

Install the 1loc library using your favorite package manager (yarn or npm).

```
$ yarn add 1loc
```

{% hint style="info" %}
&#x20;Or using NPM&#x20;
{% endhint %}

```bash
$ npm install 1loc
```

## Import and Use Any Method

```javascript
import { makeTallyByProperty } from '1loc'

const myArray = [
    { brand: 'audi', model: 'q8', year: '2019' },
    { brand: 'audi', model: 'rs7', year: '2020' },
    { brand: 'ford', model: 'mustang', year: '2019' },
    { brand: 'ford', model: 'explorer', year: '2020' },
    { brand: 'bmw', model: 'x7', year: '2020' },
]

makeTallyByProperty(myArray, 'brand') // { 'audi': 2, 'ford': 2, 'bmw': 1 }

```

That's it 🎉

## Contribute

You can contribute to this project [here](https://github.com/MartinsOnuoha/1loc-lib).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://martins-victor.gitbook.io/1loc-lib/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
