open-index/open-npm huggingface dataset:
npm package: @prima-materia/goat
Description: A graph ORM for Node.js.
Latest version: 2.0.0

# GOAT

GOAT is a graph database layer where data is represented as nodes, with edges representing relationships between nodes. The name GOAT is an acronym for Graph Objects, Associations and Types. GOAT is a runtime object graph mapping (OGM) layer, supporting multiple database engines as its underlying storage layer.

See [the docs folder](https://github.com/prima-materia-js/goat/blob/main/docs/index.md) for a guide on using GOAT.
npm package: @primacode/iterate
Description: Lazy operations on JS iterables.
Latest version: 1.0.0

# @primacode/iterate
## Lazy operations on `Iterable<T>`

This package is a set of utils functions for working with JavaScript iterators and `Iterable<T>`.

- Lazy-evaluated - reduce memory usage on big data sets.
- Built on top of native `Iterable<T>` - stick to well-established standards.
- Fully tree-shakable - add minimal code overhead.
- TypeScript support - leverage static type checking and code hints.
- Functional programming approach - use the best modern practices.
- Mimics array API - easy to understand and get started.

Inspired by wu.js, rxjs and LINQ.

## Quickstart

Install the library:

```
npm install --save @primacode/iterate
```
Import and you're good to go:

```js
import { iterate, filter } from '@primacode/iterate';

iterate([1, 2, 3])(filter(x => x < 3));
```

## Lazy evaluation

Lazy evaluation means that operations are executed just-in-time, instead of executing them eagerly.

For example - eagerly-evaluated JS code is:

```js
const result = [1, 2, 3]
  .filter(x => x < 3)
  .map(x => 'a' + x);
```

The main drawback is that it creates an array for each step in the process:

```js
const result = [1, 2, 3]
  .filter(x => x < 3)                 // -> [1, 2]
  .map(x => 'a' + x);                 // -> ['a1', 'a2']
```

In this case, lazy evaluation means processing data on the fly and creating only single array at the end. It can be particularly useful when working with large data sets.

@primacode/iterate provides convenient API for doing this:

```js
const result = iterate([1, 2, 3])(
  filter(x => x < 3),                 // -> Iterable<number>
  map(x => 'a' + x),                  // -> Iterable<string>
  toArray                             // -> ['a1', 'a2']
);
```

It's also possible to efficiently iterate the data, without creating an array:

```js
const iterable = iterate([1, 2, 3])(filter(x => x < 3));

for (const item of iterable) {
  // item = 1
  // item = 2
}
```

## References

- [typescript-starter](https://github.com/bitjson/typescript-starter) - Quickly create and configure a new library or Node.js project.
- [wu.js](https://fitzgen.github.io/wu.js/) - JavaScript library providing higher order functions for ECMAScript 6 iterators. 
- [rxjs](https://github.com/ReactiveX/rxjs) - Reactive extensions for JavaScript.
npm package: @primacrm/cli
Description: CLI tool pour développer des modules Prima CRM
Latest version: 1.0.0

# @primacrm/cli

CLI tool pour développer des modules Prima CRM.

## Installation

```bash
npm install -g @primacrm/cli
```

## Utilisation

### Créer un nouveau module

```bash
primacrm create-module my-module
```

Options:
- `-t, --template <template>` - Template à utiliser (simple, ui, db, api-external, hooks)
- `-c, --category <category>` - Catégorie du module
- `-a, --author <author>` - Auteur du module

### Mode développement

```bash
primacrm dev
```

Options:
- `-p, --port <port>` - Port du backend (défaut: 3000)
- `-h, --host <host>` - Host du backend (défaut: localhost)

### Valider un module

```bash
primacrm validate
```

Options:
- `-r, --remote` - Utiliser la validation distante (backend)
- `-u, --url <url>` - URL du backend pour validation distante

### Builder un module

```bash
primacrm build
```

Options:
- `-w, --watch` - Mode watch

### Publier un module

```bash
primacrm publish
```

Options:
- `-u, --url <url>` - URL du backend
- `-t, --token <token>` - Token d'authentification

### Lancer les tests

```bash
primacrm test
```

Options:
- `-w, --watch` - Mode watch
- `-c, --coverage` - Générer un rapport de couverture

## License

MIT
npm package: @primacrm/core
Description: SDK TypeScript pour développer des modules Prima CRM
Latest version: 1.0.0

# @primacrm/core

SDK TypeScript pour développer des modules Prima CRM.

## Installation

```bash
npm install @primacrm/core
```

## Utilisation

### Implémenter un module

```typescript
import {
  PrimaCrmModuleInterface,
  ModuleMetadata,
  IPrimaCrmApi,
} from '@primacrm/core';

class MyModule implements PrimaCrmModuleInterface {
  constructor(private api: IPrimaCrmApi) {}

  async onInstall(metadata: ModuleMetadata) {
    console.log('Module installed:', metadata.name);
  }

  async onActivate(tenantId: string) {
    console.log('Module activated for tenant:', tenantId);
  }

  async onDeactivate(tenantId: string) {
    console.log('Module deactivated for tenant:', tenantId);
  }

  async onUninstall() {
    console.log('Module uninstalled');
  }
}

export default MyModule;
```

### Utiliser les hooks

```typescript
import { Hook, CoreHooks, HookContext } from '@primacrm/core';

class MyModule {
  @Hook(CoreHooks.LEAD_AFTER_CREATE, 50)
  async onLeadCreated(data: any, context: HookContext) {
    console.log('Lead created:', data);
    // Enrichir les données
    return { ...data, enriched: true };
  }
}
```

### Utiliser les événements

```typescript
import { EventListener } from '@primacrm/core';

class MyModule {
  @EventListener('lead.created')
  async onLeadCreated(event: any) {
    console.log('Lead created event:', event);
  }
}
```

### Utiliser l'API

```typescript
import { IPrimaCrmApi } from '@primacrm/core';

class MyModule {
  constructor(private api: IPrimaCrmApi) {}

  async processLeads() {
    const leads = await this.api.getLeads();
    for (const lead of leads) {
      // Traiter le lead
      await this.api.updateLead(lead.id, { status: 'processed' });
    }
  }
}
```

## API Reference

Voir la [documentation complète](../../documentation/developer-guide/api-reference.md).

## License

MIT