open-index/open-npm huggingface dataset:
npm package: @goatfi/goat-address-book
Description: This repository contains an up-to-date registry of all addresses of the Goat Protcol's smart contracts, for its usage in Solidity codebases.
Author: Goat DAO
Latest version: 1.1.11

# Goat Address Book 📒

This repository contains an up-to-date registry of all addresses of the Goat Protocol's smart contracts, for its usage in Solidity codebases.

## Usage with foundry

With Foundry installed and being in a Git repository:

```sh
forge install goatfi/goat-address-book
```

**Import core protocol addresses from a certain network:**

```sh
import { ProtocolArbitrum } from "goat-address-book/ProtocolArbitrum.sol";
```
## Usage with node

### Install

```sh
npm i @goatfi/goat-address-book
```

### Usage

```js
import * as pools from "@goatfi/goat-address-book";
import { ProtocolArbitrum } from "@goatfi/goat-address-book";

// all variables available on solidity version are available in javascript as well
console.log(ProtocolArbitrum.TREASURY);
```
### Vault Registry

Other repositories like our api or [DefiLlama Adapters](https://github.com/DefiLlama/DefiLlama-Adapters), read the [vault registry](https://github.com/goatfi/goat-address-book/tree/main/vault-registry) to build data. The vault registry must be up to date with the vaults on the app.

### Releases

New package releases will happen when new protocol addresses or chain assets are added. New vaults added to the address-book won't trigger a new relase, but they will be added to the next version.

### Production Recommendations

While there is a index import available in "GoatAddressBook.sol", we only recommend using it in tests.
Foundry currently does not eliminate unused code for [verification](https://github.com/foundry-rs/foundry/issues/2266).
This results in rather gigantic verifications when using the index file import from [GoatAddressBook.sol](./src/GoatAddressBook.sol).
For production code we therefore recommend to use specific libraries exported from `goat-address-book` like `ProtocolArbitrum` for the protocol addresses on Arbitrum.

### Credits
This repository was heavily inspired by [@bgd-lads](https://github.com/bgd-labs)'s [Aave Address Book](https://github.com/bgd-labs/aave-address-book) repository.
npm package: @goatlab/biome
Description: Shared Biome configuration for GoatLab projects
Latest version: 0.1.1

# @goatlab/biome

Shared Biome configuration for GoatLab projects.

## Installation

```bash
pnpm add -D @goatlab/biome @biomejs/biome
```

## Usage

Create a `biome.json` file in your project root:

```json
{
  "$schema": "https://biomejs.dev/schemas/2.1.3/schema.json",
  "extends": ["../../packages/biome/biome.json"]
}
```

Or if using the published package:

```json
{
  "$schema": "https://biomejs.dev/schemas/2.1.3/schema.json",
  "extends": ["node_modules/@goatlab/biome/biome.json"]
}
```

## Scripts

Add these scripts to your `package.json`:

```json
{
  "scripts": {
    "format": "biome format --write .",
    "lint": "biome lint --write .",
    "check": "biome check --write ."
  }
}
```

## VS Code Integration

Install the [Biome VS Code extension](https://marketplace.visualstudio.com/items?itemName=biomejs.biome) and add this to your workspace settings:

```json
{
  "editor.defaultFormatter": "biomejs.biome",
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "quickfix.biome": "explicit",
    "source.organizeImports.biome": "explicit"
  }
}
```

## Rule Mappings from ESLint

This configuration includes equivalent rules for the following ESLint/Prettier settings:

### Formatting (from Prettier)
- `printWidth: 80` → `lineWidth: 80`
- `trailingComma: "none"` → `trailingCommas: "none"`
- `singleQuote: true` → `quoteStyle: "single"`
- `semi: false` → `semicolons: "asNeeded"`
- `tabWidth: 2` → `indentWidth: 2`
- `arrowParens: "avoid"` → `arrowParentheses: "asNeeded"`

### Linting (from ESLint)
- TypeScript naming conventions
- Import organization
- Unused imports/variables removal
- Complexity limits (max 30)
- Various code quality rules

See the [biome.json](./biome.json) file for the complete configuration.
npm package: @goatlab/cli
Description: Control your Goat apps using any terminal
Author: ignacio.cabrera@goatlab.io
Latest version: 0.1.0

# Goat - CLI

Use your terminal to create and manage your Goat projects and libraries

### Installing

This CLI just be installed globally to create new Goat projects

```
npm install -g @goatlab/cli
```

### Documentation

To learn how to use this visit the [Goat Docs](https://docs.goatlab.io)
npm package: @goatlab/dates
Description: Readable query Interface & API generator for TS and Node
Author: ignacio.cabrera@goatlab.io
Latest version: 0.6.7

<!-- PROJECT SHIELDS -->

[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

<!-- PROJECT LOGO -->
<br />
<p align="center">
  <a href="https://github.com/github_username/repo">
       <img src="https://docs.goatlab.io/logo.png" alt="Logo" width="150" height="150">
  </a>

  <h3 align="center">GOAT-FLUENT</h3>

  <p align="center">
    Readable query Interface & API generator
    <br />
    <a href="https://docs.goatlab.io/#/0.5.x/fluent/fluent"><strong>Explore the docs »</strong></a>
    <br />
    <br />
    <a href="https://codesandbox.io/s/goat-nestjs-tytmv?file=/src/main.ts">View Demo</a>
    ·
    <a href="https://github.com/goat-io/fluent/issues">Report Bug</a>
    ·
    <a href="https://github.com/goat-io/fluent/issues">Request Feature</a>
  </p>
</p>

# Goat - Fluent
npm package: @goatlab/dependency-check
Description: NPM and JAVA dependency analyser
Author: Natural Cycles Team
Latest version: 0.0.10

# Dependency Checker

Analyze NPM and JAVA dependencies that your project depends on.
Quickly view a list of open issues and aggregated data for each open-source package.

Check [this link](https://depchecker.com/blog/analyze-project-deps/) for more information on how packages are analyzed.
 

## Installation

You can either install it globally 
```bash
npm install -g @naturalcycles/dependency-check
```

or as one of your dev dependencies.

```bash
npm install --save-dev @naturalcycles/dependency-check
```

## Running the checker

As dependency checker queries multiple Github sources, set your own github token while/before running it.

```bash
GITHUB_TOKEN=<my-github-token> nc-depcheck
```


## Development

Clone this repo to your workspace

```bash
git clone https://github.com/NaturalCycles/dependency-check.git
```

install dependencies

```bash
npm install
```

link this package to be able to use it globally.

```bash
npm link
```

And finally build it in watch mode

```bash
npm run watch
```
npm package: @goatlab/eslint
Description: Shared ESLint configuration for the Goat Fluent monorepo, providing consistent TypeScript, Jest, and code quality rules across all packages.
Latest version: 0.2.0

# @goatlab/eslint

Shared ESLint configuration for the Goat Fluent monorepo, providing consistent TypeScript, Jest, and code quality rules across all packages.

## Installation

```bash
pnpm add -D @goatlab/eslint eslint
```

## Usage

Create an `.eslintrc.js` file in your package root:

```js
module.exports = require('@goatlab/eslint/eslint.config.js')
```

Or extend it with custom rules:

```js
const baseConfig = require('@goatlab/eslint/eslint.config.js')

module.exports = {
  ...baseConfig,
  // your custom overrides
}
```

## What's Included

- **TypeScript Support**: Full TypeScript linting with type-aware rules via `@typescript-eslint`
- **Code Quality**: Airbnb base configuration with custom rules for consistent code style
- **Jest Integration**: Automatically includes Jest rules when Jest is installed in your project
- **Import Management**: Import ordering and unused import detection
- **Framework Support**: Vue.js file support with proper parser configuration
- **Prettier Integration**: Configured to work seamlessly with Prettier formatting
- **Unicorn Rules**: Best practices and improvements via `eslint-plugin-unicorn`

## Key Features

- Automatically detects Jest and applies testing rules only when needed
- Strict naming conventions (camelCase for variables/functions, PascalCase for types)
- Comprehensive error prevention rules
- Optimized for TypeScript projects with proper type checking
- Ignores common build artifacts (`node_modules`, `dist`, `coverage`, `.turbo`)
npm package: @goatlab/fluent-firebase
Description: Readable query Interface & API generator for TS and Node
Author: ignacio.cabrera@goatlab.io
Latest version: 0.9.32

# @goatlab/fluent-firebase

Firebase/Firestore connector for the Goat Fluent query interface. Provides a type-safe, schema-validated query builder for Firebase Firestore with support for complex queries, batch operations, and relations.

## Installation

```bash
npm install @goatlab/fluent-firebase
# or
yarn add @goatlab/fluent-firebase
# or
pnpm add @goatlab/fluent-firebase
```

## Basic Usage

```typescript
import { FirebaseInit, FirebaseConnector } from '@goatlab/fluent-firebase'
import { Entity, ObjectType, f } from '@goatlab/fluent'
import { z } from 'zod'

// Initialize Firebase
FirebaseInit({
  databaseName: 'your-project-id',
  serviceAccount: './path/to/service-account.json', // optional
  emulator: false // set to true for local development
})

// Define your entity
@Entity('users')
@ObjectType()
export class UserEntity {
  @f.Column()
  id: string

  @f.Column()
  name: string

  @f.Column()
  email: string

  @f.Column()
  created: Date
}

// Define your schema
const UserSchema = z.object({
  id: z.string().optional(),
  name: z.string(),
  email: z.string().email(),
  created: z.date().optional()
})

// Create a repository
class UserRepository extends FirebaseConnector<UserEntity> {
  constructor() {
    super({
      entity: UserEntity,
      inputSchema: UserSchema,
      outputSchema: UserSchema // optional, defaults to inputSchema
    })
  }
}

// Use the repository
const userRepo = new UserRepository()

// Insert
const user = await userRepo.insert({
  name: 'John Doe',
  email: 'john@example.com'
})

// Query
const users = await userRepo.findMany({
  where: { email: 'john@example.com' },
  limit: 10,
  orderBy: [{ created: 'desc' }]
})

// Update
await userRepo.updateById(user.id, { name: 'Jane Doe' })

// Delete
await userRepo.deleteById(user.id)
```

## Key Features

- **Type-safe queries** with TypeScript and Zod schema validation
- **Fluent query interface** compatible with other Goat Fluent connectors
- **Complex query support** including AND/OR conditions and multiple operators
- **Batch operations** for efficient bulk inserts and updates
- **Relations support** for loading related data
- **Firebase Emulator support** for local development and testing
- **Raw access** to Firebase Admin SDK when needed

## License

MIT
npm package: @goatlab/fluent-formio
Description: Readable query Interface & API generator for TS and Node
Author: ignacio.cabrera@goatlab.io
Latest version: 0.8.32

# @goatlab/fluent-formio

A fluent query interface connector for Form.io that provides a type-safe, consistent API for CRUD operations with Form.io data sources.

## Installation

```bash
npm install @goatlab/fluent-formio
# or
yarn add @goatlab/fluent-formio
# or
pnpm add @goatlab/fluent-formio
```

## Basic Usage

```typescript
import { FormioConnector } from '@goatlab/fluent-formio'

// Create a connector instance
const userConnector = new FormioConnector({
  baseEndPoint: 'https://api.form.io/project/users',
  token: 'your-formio-jwt-token'
})

// Perform CRUD operations
const user = await userConnector.insert({
  data: {
    name: 'John Doe',
    email: 'john@example.com'
  }
})

const users = await userConnector.findMany({
  where: { 'data.status': 'active' },
  limit: 10
})
```

## Key Features

- **Form.io REST API Integration** - Full support for Form.io submission and form APIs
- **Type-Safe Queries** - TypeScript support with auto-completion
- **Fluent Query Builder** - Chainable query methods for complex operations
- **Built-in Mock Storage** - In-memory implementation for testing and development
- **Form.io Authentication** - JWT token and API key support
- **Advanced Filtering** - Support for nested properties, date ranges, and complex conditions

## Documentation

For comprehensive documentation, see the [Form.io Connector Guide](https://docs.goatlab.io/connectors/formio).

## License

MIT
npm package: @goatlab/fluent-loki
Description: Readable query Interface & API generator for TS and Node
Author: ignacio.cabrera@goatlab.io
Latest version: 0.9.32

# @goatlab/fluent-loki

LokiJS connector for Goat Fluent - a fast, in-memory database adapter with optional persistence.

## Installation

```bash
npm install @goatlab/fluent-loki
```

## Basic Usage

```typescript
import { Loki, LokiConnector, LokiStorageType } from '@goatlab/fluent-loki'
import { z } from 'zod'

// Define schema
const UserSchema = z.object({
  id: z.string(),
  name: z.string(),
  email: z.string().email(),
  age: z.number().optional()
})

// Create database
const db = Loki.createDb({
  dbName: 'myapp',
  storage: LokiStorageType.memory
})

// Create connector
const users = new LokiConnector({
  entity: { name: 'User' },
  dataSource: db,
  inputSchema: UserSchema,
  outputSchema: UserSchema
})

// Use Fluent API
const user = await users.insert({
  name: 'John Doe',
  email: 'john@example.com',
  age: 30
})

const results = await users.findMany({
  where: { age: { gte: 18 } },
  orderBy: [{ name: 'asc' }],
  limit: 10
})
```

## Key Features

- **In-Memory Performance** - Lightning-fast operations ideal for testing and prototyping
- **Multiple Storage Options** - Memory, IndexedDB, file system, and encrypted storage
- **Fluent Query Interface** - Compatible with all Goat Fluent query patterns
- **Schema Validation** - Built-in Zod validation for type safety
- **Complex Queries** - Support for nested properties, AND/OR conditions, regex
- **Change Tracking** - Monitor document changes with event listeners
- **No External Dependencies** - Pure JavaScript implementation

## License

MIT
npm package: @goatlab/fluent-memory
Description: Readable query Interface & API generator for TS and Node
Author: ignacio.cabrera@goatlab.io
Latest version: 0.6.5

<!-- PROJECT SHIELDS -->

[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

<!-- PROJECT LOGO -->
<br />
<p align="center">
  <a href="https://github.com/github_username/repo">
       <img src="https://docs.goatlab.io/logo.png" alt="Logo" width="150" height="150">
  </a>

  <h3 align="center">GOAT-FLUENT</h3>

  <p align="center">
    Readable query Interface & API generator
    <br />
    <a href="https://docs.goatlab.io/#/0.5.x/fluent/fluent"><strong>Explore the docs »</strong></a>
    <br />
    <br />
    <a href="https://codesandbox.io/s/goat-nestjs-tytmv?file=/src/main.ts">View Demo</a>
    ·
    <a href="https://github.com/goat-io/fluent/issues">Report Bug</a>
    ·
    <a href="https://github.com/goat-io/fluent/issues">Request Feature</a>
  </p>
</p>

# Goat - Fluent
npm package: @goatlab/fluent-pouchdb
Description: Fluent query Interface for Pouchdb
Author: ignacio.cabrera@goatlab.io
Latest version: 0.9.32

# @goatlab/fluent-pouchdb

PouchDB connector for the Goat Fluent query interface. Enables offline-first applications with automatic synchronization capabilities.

## Installation

```bash
npm install @goatlab/fluent-pouchdb
# or
yarn add @goatlab/fluent-pouchdb
# or
pnpm add @goatlab/fluent-pouchdb
```

## Basic Usage

```typescript
import { PouchDBConnector, PouchDB } from '@goatlab/fluent-pouchdb'
import { f } from '@goatlab/fluent'
import { z } from 'zod'

// Define entity
@f.entity('users')
class UserEntity {
  @f.id()
  id?: string
  
  @f.property({ required: true })
  name: string
  
  @f.property({ required: true })
  email: string
  
  @f.created()
  createdAt?: Date
}

// Define schema
const UserSchema = z.object({
  id: z.string().optional(),
  name: z.string(),
  email: z.string().email(),
  createdAt: z.date().optional()
})

// Create PouchDB instance
const db = new PouchDB('users')

// Initialize connector
const users = new PouchDBConnector({
  entity: UserEntity,
  dataSource: db,
  inputSchema: UserSchema
})

// Use Fluent API
const user = await users.insert({ 
  name: 'John Doe', 
  email: 'john@example.com' 
})

// Query data
const found = await users.findMany({
  where: { email: { equals: 'john@example.com' } },
  orderBy: [{ createdAt: 'desc' }],
  limit: 10
})

// Sync with CouchDB
db.sync('http://localhost:5984/users', {
  live: true,
  retry: true
})
```

## Key Features

- **Offline-First** - Works without internet connection
- **Automatic Sync** - Bidirectional replication with CouchDB
- **Unified Fluent API** - Same query interface as other Fluent connectors
- **Schema Validation** - Input/output validation with Zod
- **Multiple Adapters** - IndexedDB, WebSQL, LevelDB, and in-memory
- **Conflict Resolution** - Built-in handling for sync conflicts
- **Raw Access** - Direct PouchDB database access via `.raw()` method

## Documentation

For comprehensive documentation, see the [Fluent PouchDB docs](https://docs.goatlab.io/0.1.x/connectors/pouchdb.html).

## License

MIT
npm package: @goatlab/fluent-rest
Description: Readable query Interface & API generator for TS and Node
Author: ignacio.cabrera@goatlab.io
Latest version: 0.7.1

<!-- PROJECT SHIELDS -->

[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

<!-- PROJECT LOGO -->
<br />
<p align="center">
  <a href="https://github.com/github_username/repo">
       <img src="https://docs.goatlab.io/logo.png" alt="Logo" width="150" height="150">
  </a>

  <h3 align="center">GOAT - FLUENT-REST</h3>

  <p align="center">
    Fluent - Time Saving (TS) utils
    <br />
    <a href="https://docs.goatlab.io/#/0.7.x/fluent/fluent"><strong>Explore the docs »</strong></a>
    <br />
    <br />
    ·
    <a href="https://github.com/goat-io/fluent/issues">Report Bug</a>
    ·
    <a href="https://github.com/goat-io/fluent/issues">Request Feature</a>
  </p>
  </p>
</p>

# Goat - Fluent

Fluent query interface for Multiple database types and helpers for fast API generation and general App building.

### Installing

To install this package in your project, you can use the following command within your terminal.

```bash
yarn add @goatlab/fluent-rest
```

### Documentation

To learn how to use this visit the [Goat Docs](https://docs.goatlab.io/#/0.7.x/fluent/fluent)
npm package: @goatlab/fluentjs
Description: Readable query Interface & API generator for TS and Node
Author: ignacio.cabrera@goatlab.io
Latest version: 0.7.0

# @goatlab/fluentjs

A JavaScript implementation of the Goat Fluent query interface, providing a readable and composable way to work with multiple database types including LokiJS, Firebase, and remote APIs.

## Installation

```bash
npm install @goatlab/fluentjs
```

## Basic Usage

```javascript
import Fluent from '@goatlab/fluentjs'

// Configure connectors
Fluent.config({
  LOCAL_CONNECTORS: [
    {
      name: 'loki',
      connector: LokiConnector,
      default: true
    }
  ],
  REMOTE_CONNECTORS: [
    {
      name: 'api',
      connector: ApiConnector
    }
  ]
})

// Create a model
const User = Fluent.model({
  properties: {
    name: 'User'
  }
})

// Query data
const users = await User.local()
  .where('age', '>', 18)
  .orderBy('name')
  .get()
```

## Key Features

- **Multiple Database Support** - Works with LokiJS (in-memory), Firebase, Form.io, and custom APIs
- **Fluent Query Interface** - Chainable methods for intuitive query building
- **Composable Models** - Built with stampit for flexible model composition
- **Local/Remote/Merge Modes** - Query local cache, remote API, or merge both
- **Browser & Node.js** - Works in both environments
- **Collection Utilities** - Built-in collection manipulation tools
- **Form.io Integration** - Special support for Form.io forms and submissions
npm package: @goatlab/formio-utils
Description: Readable query Interface & API generator for TS and Node
Author: ignacio.cabrera@goatlab.io
Latest version: 0.9.4

# @goatlab/formio-utils

TypeScript utilities for parsing and validating Form.io forms. Generate models, controllers, and repositories for NestJS and Loopback frameworks from Form.io schemas.

## Installation

```bash
npm install @goatlab/formio-utils
# or
yarn add @goatlab/formio-utils
# or
pnpm add @goatlab/formio-utils
```

## Basic Usage

### Form Parsing and Code Generation

```typescript
import { Formio, SupportedFrameworks } from '@goatlab/formio-utils'
import type { FormioForm } from '@goatlab/formio-utils'

// Define a Form.io form
const form: FormioForm = {
  title: 'User Registration',
  name: 'userRegistration',
  path: 'user',
  components: [
    {
      type: 'textfield',
      key: 'name',
      label: 'Name',
      validate: { required: true }
    },
    {
      type: 'number',
      key: 'age',
      label: 'Age'
    }
  ]
}

// Parse form and generate NestJS/Loopback code
const parsedModels = await Formio.parse(form, SupportedFrameworks.Nest)

// Access generated code
parsedModels.forEach(model => {
  console.log(model.controller) // Generated controller code
  console.log(model.repository) // Generated repository code
  console.log(model.models)     // Generated model code
  console.log(model.types)      // Generated TypeScript types
})
```

### Form Validation

```typescript
import { Validate } from '@goatlab/formio-utils/dist/Formio/validator/Validate'

// Validate form submission
const submission = {
  data: {
    name: 'John Doe',
    age: 25
  }
}

try {
  const validatedData = await Validate.submission(form, submission)
  console.log('Valid submission:', validatedData)
} catch (error) {
  console.error('Validation errors:', error.details)
}
```

### Form Utilities

```typescript
// Get all form components
Formio.eachComponent(form, (component) => {
  console.log(component.key, component.type)
})

// Find specific components
const textFields = Formio.findComponents(form, { type: 'textfield' })

// Get table view components
const tableColumns = Formio.tableViewComponents(form)

// Get form labels
const labels = Formio.labels(form)
```

## Key Features

- **Form Parsing**: Convert Form.io schemas into framework-specific code (NestJS, Loopback)
- **Form Validation**: Validate form submissions against Form.io schemas with detailed error reporting
- **Code Generation**: Automatically generate models, controllers, repositories, and TypeScript types
- **Form Utilities**: Helper functions for working with Form.io components (find, flatten, iterate)
- **TypeScript Support**: Full TypeScript support with exported types
- **Framework Support**: Generate code for NestJS and Loopback frameworks
npm package: @goatlab/js-html
Description: Parses html to make it app/react native friendly
Author: ignacio.cabrera@goatlab.io
Latest version: 0.1.3

# @goatlab/js-html

A TypeScript HTML processing library that provides sanitization, parsing, text extraction, and truncation capabilities with support for linkification and custom keywords.

## Installation

```bash
npm install @goatlab/js-html
```

or

```bash
yarn add @goatlab/js-html
```

## Usage

```typescript
import { HtmlProcessor } from '@goatlab/js-html';

// Basic HTML processing
const processor = new HtmlProcessor({ 
  html: '<div>Hello <b>World</b></div>' 
});

// Get sanitized and parsed HTML
const parsedHtml = processor.getParsedHtml();

// Truncate HTML with ellipsis
const truncated = processor.getTruncatedHtml({
  truncate: 50,
  ellipsis: '... Read more'
});

// Extract plain text from HTML
const text = HtmlProcessor.extractTextFromHTML('<p>Hello <b>World</b></p>');
// Output: "Hello World"

// Check if HTML is empty
const isEmpty = HtmlProcessor.isEmptyHTML('<div>   </div>');
// Output: true

// Clean HTML (remove empty tags and whitespace)
const cleaned = processor.cleanHTML('<div><p></p>Hello</div>');
```

## Key Features

- **HTML Sanitization**: Removes dangerous tags and attributes while preserving safe content
- **Text Extraction**: Extract plain text content from HTML markup
- **Smart Truncation**: Truncate HTML content while preserving tag structure
- **Empty HTML Detection**: Check if HTML contains meaningful content
- **Linkification**: Automatically convert URLs, mentions, hashtags, and custom keywords into links
- **Keyword Registration**: Define custom keywords for special link handling
- **Clean HTML**: Remove empty tags and unnecessary whitespace
npm package: @goatlab/js-utils
Description: Readable query Interface & API generator for TS and Node
Author: ignacio.cabrera@goatlab.io
Latest version: 0.10.3

# @goatlab/js-utils

A comprehensive collection of TypeScript utilities for both Node.js and browser environments. This package provides essential helpers for working with arrays, objects, strings, promises, HTTP requests, and more.

## Installation

```bash
npm install @goatlab/js-utils
# or
yarn add @goatlab/js-utils
# or
pnpm add @goatlab/js-utils
```

## Basic Usage

```typescript
import { Arrays, Objects, Strings, Promises, Http } from '@goatlab/js-utils'

// Array utilities
const numbers = [1, 2, 3, 4, 5, 6]
const chunks = Arrays.chunk(numbers, 2) // [[1, 2], [3, 4], [5, 6]]
const first = Arrays.first(numbers) // 1
const last = Arrays.last(numbers) // 6

// Object utilities
const obj = { a: 1, b: 2, c: 3 }
const picked = Objects.pick(obj, ['a', 'c']) // { a: 1, c: 3 }
const omitted = Objects.omit(obj, ['b']) // { a: 1, c: 3 }
const isEmpty = Objects.isEmpty({}) // true

// String utilities
const camelCase = Strings.camelCase('hello-world') // 'helloWorld'
const snakeCase = Strings.snakeCase('helloWorld') // 'hello_world'
const truncated = Strings.truncate('long text here', 8) // 'long tex...'

// Promise utilities
const [err, result] = await Promises.try(fetchData())
const results = await Promises.map(items, async (item) => process(item), { concurrency: 3 })

// HTTP client (based on ky)
const client = Http.getClient({ 
  prefixUrl: 'https://api.example.com',
  timeout: 30000 
})
const data = await client.get('users').json()
```

## Available Utilities

### Core Utilities

- **Arrays** - `chunk`, `first`, `last`, `flatten`, `uniq`, `sortBy`, `groupBy`
- **Objects** - `pick`, `omit`, `merge`, `isEmpty`, `deepEquals`, `mapValues`, `filterValues`
- **Strings** - `camelCase`, `snakeCase`, `kebabCase`, `truncate`, `before`, `after`, `template`
- **Numbers** - `round`, `random`, `inRange`, `clamp`
- **Functions** - `debounce`, `throttle`, `once`, `memoize`
- **Promises** - `try`, `map`, `props`, `retry`, `hang`

### Data & Collections

- **Collection** - Chainable collection operations
- **Ids** - UUID and nanoid generation
- **Time** - Time formatting (`ms`, `since`)
- **Units** - Unit conversions

### Error Handling

- **Errors** - Error utilities and custom error classes
- **AppError** - Application-specific errors
- **HttpError** - HTTP-specific errors
- **Assert** - Assertion utilities

### HTTP & Browser

- **Http** - HTTP client wrapper (ky-based)
- **BrowserEvents** - Browser event utilities

### Advanced Features

- **Is** - Type checking utilities
- **Memo** - Memoization decorators
- **Inspect** - Object inspection utilities
- **Changelogs** - Changelog generation
- **nGram** - N-gram text analysis

### Date & Time

- **LocalDate** - Date handling without time
- **LocalTime** - Time handling without date
- **DateInterval** - Date range operations
- **TimeInterval** - Time range operations
npm package: @goatlab/metabase
Description: Metabase API wrapper for TypeScript and Node.js
Author: ignacio.cabrera@goatlab.io
Latest version: 0.1.5

# @goatlab/metabase

A comprehensive TypeScript wrapper for the Metabase API, providing a fluent interface for admin operations, collections, questions, dashboards, and permission management.

## Installation

```bash
npm install @goatlab/metabase
# or
pnpm add @goatlab/metabase
# or
yarn add @goatlab/metabase
```

## Basic Usage

```typescript
import { MetabaseApi } from '@goatlab/metabase'

// Initialize with session token
const api = new MetabaseApi({
  baseUrl: 'https://your-metabase-instance.com',
  sessionToken: 'your-session-token'
})

// Or initialize with API key (preferred for automation)
const api = new MetabaseApi({
  baseUrl: 'https://your-metabase-instance.com',
  apiKey: 'your-api-key'
})

// Example: Create a collection
const collectionId = await api.collections.getOrCreate({
  collectionName: 'My Reports'
})

// Example: Enable embeddings
await api.admin.enableEmbeddings()
```

## Key Features

### Static Methods (Pre-authentication)
- `MetabaseApi.waitForMetabase()` - Wait for Metabase instance to be ready
- `MetabaseApi.createAdminUser()` - Create initial admin user
- `MetabaseApi.loginAdminUser()` - Login and get session token

### Admin Operations
- `api.admin.enableEmbeddings()` - Enable embedding functionality
- `api.admin.deleteSampleDatabase()` - Remove sample database
- `api.admin.disableOnboardingSidebar()` - Hide onboarding UI
- `api.admin.disableTracking()` - Disable analytics tracking
- `api.admin.addDataSource()` - Add new database connection
- `api.admin.enableActionsInDatasource()` - Enable actions for a datasource
- `api.admin.createApiKey()` - Generate API keys
- `api.admin.getEmbeddingSecretKey()` - Retrieve embedding secret

### Collections
- `api.collections.getOrCreate()` - Get or create collection by name
- `api.collections.delete()` - Delete a collection
- `api.collections.deleteAll()` - Remove all collections

### Questions (Cards)
- `api.questions.getOrCreate()` - Get or create a question
- `api.questions.getOrCreateAccounts()` - Create accounts-specific question

### Dashboards
- `api.dashboards.getOrCreate()` - Get or create dashboard

### Permission Groups
- `api.groups.create()` - Create new permission group
- `api.groups.getOrCreate()` - Get or create group by name
- `api.groups.list()` - List all groups
- `api.groups.disableAllDatabaseAccess()` - Revoke all database permissions
- `api.groups.disableAllUsersGroupDatabaseAccess()` - Disable default user group access
- `api.groups.grantDatabaseAccessByPrefix()` - Grant access to databases by name prefix
- `api.groups.setDatabasePermissionsForGroup()` - Set specific database permissions
- `api.groups.updatePermissions()` - Update group permissions
npm package: @goatlab/node-cli
Description: Node Helpers to Build CLI
Author: ignacio.cabrera@goatlab.io
Latest version: 0.8.2

<!-- PROJECT SHIELDS -->

[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

<!-- PROJECT LOGO -->
<br />
<p align="center">
  <a href="https://github.com/github_username/repo">
       <img src="https://docs.goatlab.io/logo.png" alt="Logo" width="150" height="150">
  </a>

  <h3 align="center">GOAT - NODE UTILS</h3>

  <p align="center">
    Fluent - Time Saving (TS) utils
    <br />
    <a href="https://docs.goatlab.io/#/0.7.x/fluent/fluent"><strong>Explore the docs »</strong></a>
    <br />
    <br />
    ·
    <a href="https://github.com/goat-io/fluent/issues">Report Bug</a>
    ·
    <a href="https://github.com/goat-io/fluent/issues">Request Feature</a>
  </p>
  </p>
</p>

# Goat - JS UTILS

General Node only Time Saving (TS) utilities

### Installing

To install this package in your project, you can use the following command within your terminal.

```bash
yarn add @goatlab/node-utils
```

### Documentation

To learn how to use this visit the [Goat Docs](https://docs.goatlab.io/#/0.7.x/fluent-helpers/overview)
npm package: @goatlab/node-metascraper
Description: Wrapper around metascrapper to ease the process of getting metadata from a url
Author: ignacio.cabrera@goatlab.io
Latest version: 0.1.7

# @goatlab/node-metascraper

A Node.js wrapper around metascraper that simplifies metadata extraction from URLs. Supports both standard HTTP requests and Puppeteer-based scraping for JavaScript-heavy sites, with built-in image metadata extraction.

## Installation

```bash
npm install @goatlab/node-metascraper
# or
yarn add @goatlab/node-metascraper
# or
pnpm add @goatlab/node-metascraper
```

## Usage

```typescript
import { MetaScrapers } from '@goatlab/node-metascraper'

// Initialize without browser service (uses local Puppeteer)
const scraper = new MetaScrapers()

// Or initialize with remote browser service URL
const scraper = new MetaScrapers('http://your-browser-service:3000')

// Extract metadata from a URL
const metadata = await scraper.getMetadataFromUrl('https://example.com')

console.log(metadata)
// {
//   url: 'https://example.com',
//   title: 'Example Domain',
//   description: 'Example Domain. This domain is for use in illustrative examples...',
//   image: 'https://example.com/image.png',
//   author: 'Author Name',
//   date: '2024-01-01',
//   logo: 'https://example.com/logo.png',
//   publisher: 'Example',
//   domain: 'example.com',
//   lang: 'en',
//   feed: 'https://example.com/feed',
//   assetMeta: {
//     // Image metadata including dimensions, format, etc.
//     buffer: Buffer // Original image buffer
//   }
// }

// Extract metadata from an image URL directly
const imageMeta = await scraper.getAssetMetadata('https://example.com/image.png')
```

## Key Features

- **Automatic fallback** from simple HTTP requests to Puppeteer for JavaScript-rendered pages
- **Comprehensive metadata extraction** including title, description, author, date, publisher, language, and more
- **Image metadata analysis** with dimensions, format detection, and buffer access
- **RSS feed detection** with automatic title extraction
- **Malformed URL handling** with automatic correction
- **Remote browser support** for scalable Puppeteer operations
- **Built-in retry logic** that falls back to logo if main image fails
npm package: @goatlab/node-xlsx
Description: Efficiently work with xlsx files streams in Node.js
Author: ignacio.cabrera@goatlab.io
Latest version: 0.1.10

# @goatlab/node-xlsx

Efficiently stream and process Excel (.xlsx) files in Node.js with TypeScript support. Built on top of xlstream for memory-efficient processing of large Excel files.

## Installation

```bash
npm install @goatlab/node-xlsx
# or
yarn add @goatlab/node-xlsx
# or
pnpm add @goatlab/node-xlsx
```

## Basic Usage

```typescript
import { xlsxStream } from '@goatlab/node-xlsx'

// Process rows individually
await xlsxStream.stream({
  file: {
    filePath: './data.xlsx',
    sheet: 0,
    withHeader: true
  },
  rowMapper: (row) => ({
    name: row.Name,
    email: row.Email,
    age: Number(row.Age)
  }),
  fx: async (mappedRow) => {
    // Process each row
    console.log(mappedRow)
  },
  mapOptions: {
    concurrency: 4
  }
})

// Process rows in batches
await xlsxStream.batchStream({
  file: {
    filePath: './data.xlsx',
    sheet: 0,
    withHeader: true
  },
  batchSize: 100,
  rowMapper: (row) => ({
    name: row.Name,
    email: row.Email
  }),
  fx: async (batch) => {
    // Process batch of rows
    await saveToDatabase(batch)
  },
  mapOptions: {
    concurrency: 2
  }
})
```

## Key Features

- **Memory-efficient streaming** - Process large Excel files without loading them entirely into memory
- **TypeScript support** - Full type safety with generic column typing
- **Flexible row mapping** - Transform rows with custom mapper functions
- **Batch processing** - Process rows individually or in configurable batches
- **Concurrent processing** - Control concurrency for optimal performance
- **Row filtering** - Skip rows by returning `null` from the mapper function
- **Sheet selection** - Choose which sheet to process by index
- **Header support** - Automatically use first row as column headers
npm package: @goatlab/queue-node
Description: Readable query Interface & API generator for TS and Node
Author: ignacio.cabrera@goatlab.io
Latest version: 0.9.0

# @goatlab/queue-node

A Node.js-based scheduler implementation for the Goat queue system. This package provides a simple cron-based job scheduler using the `node-cron` library for executing recurring tasks.

## Installation

```bash
npm install @goatlab/queue-node
# or
yarn add @goatlab/queue-node
# or
pnpm add @goatlab/queue-node
```

## Usage

```typescript
import { NodeScheduler } from '@goatlab/queue-node'

const scheduler = new NodeScheduler()

// Schedule a job to run every minute
await scheduler.schedule({
  jobName: 'my-task',
  data: { message: 'Hello World' },
  repeat: {
    cronTime: 'minute',
    runOnInit: false,
    timeZone: 'EuropeStockholm'
  },
  handle: async (job) => {
    console.log('Job running:', job.name, job.data)
  }
})
```

## Features

- **Cron-based scheduling** - Built on top of the `cron` package for reliable task scheduling
- **Flexible intervals** - Support for various predefined intervals (seconds, minutes, hours)
- **Timezone support** - Schedule jobs in specific timezones
- **Queue-core compatible** - Implements the `Scheduler` interface from `@goatlab/queue-core`
- **Immediate execution** - Jobs without repeat settings run once after 250ms
npm package: @goatlab/tasks-adapter-gcp
Description: Cloud Tasks adapter for Goatlab tasks
Author: ignacio.cabrera@goatlab.io
Latest version: 0.4.11

# @goatlab/tasks-adapter-gcp

Google Cloud Tasks adapter for the Goat task processing system. Provides a connector to queue and manage asynchronous tasks using Google Cloud Tasks with built-in encryption and retry logic.

## Installation

```bash
npm install @goatlab/tasks-adapter-gcp
# or
yarn add @goatlab/tasks-adapter-gcp
# or
pnpm add @goatlab/tasks-adapter-gcp
```

## Usage

```typescript
import { CloudTaskConnector } from '@goatlab/tasks-adapter-gcp'
import { ShouldQueue } from '@goatlab/tasks-core'

// Initialize the connector
const cloudTask = new CloudTaskConnector({
  gcpServiceAccount: {
    project_id: 'your-project-id',
    client_email: 'service-account@project.iam.gserviceaccount.com',
    private_key: '-----BEGIN PRIVATE KEY-----\n...',
    // ... other service account fields
  },
  location: 'europe-west1',
  encryptionKey: 'your-encryption-key',
  gcpProject: 'your-project-id'
})

// Create a task class
class ProcessOrderTask extends ShouldQueue<{ orderId: string }> {
  postUrl = 'https://api.example.com/process-order'
  taskName = 'process_order'

  async handle(taskBody: { orderId: string }): Promise<void> {
    // Your task logic here
    console.log('Processing order:', taskBody.orderId)
  }
}

// Queue a task
const task = new ProcessOrderTask({ connector: cloudTask })
const status = await task.queue({ orderId: '12345' })

// Check task status
const taskStatus = await task.getStatus(status.id)
console.log('Task status:', taskStatus.status) // QUEUED, RUNNING, COMPLETED, or FAILED
```

## Key Features

- **Automatic encryption**: Task payloads are encrypted before transmission and decrypted on retrieval
- **Retry configuration**: Built-in exponential backoff retry logic for failed tasks
- **Status tracking**: Monitor task execution status (QUEUED, RUNNING, COMPLETED, FAILED)
- **Queue management**: Support for multiple named queues (defaults to 'default')
- **Full Cloud Tasks integration**: Access to all Google Cloud Tasks features through the underlying client

## Configuration Options

- `gcpServiceAccount`: Google Cloud service account credentials (or path to key file)
- `location`: GCP region for Cloud Tasks (default: 'europe-west1')
- `encryptionKey`: Key for encrypting/decrypting task payloads
- `gcpProject`: Google Cloud project ID
- `queueName`: Task queue name (default: 'default')
- `backoffSettings`: Custom retry configuration for task execution
npm package: @goatlab/tasks-adapter-hatchet
Description: Hatchet Tasks adapter for Goatlab tasks
Author: ignacio.cabrera@goatlab.io
Latest version: 0.4.11

# @goatlab/tasks-adapter-hatchet

Hatchet adapter for Goatlab's task processing system. Provides a seamless integration with [Hatchet](https://hatchet.run/) workflow engine for distributed task processing.

## Installation

```bash
npm install @goatlab/tasks-adapter-hatchet
# or
yarn add @goatlab/tasks-adapter-hatchet
# or
pnpm add @goatlab/tasks-adapter-hatchet
```

## Basic Usage

```typescript
import { HatchetConnector } from '@goatlab/tasks-adapter-hatchet'
import { ShouldQueue } from '@goatlab/tasks-core'

// Initialize Hatchet connector
const hatchetConnector = new HatchetConnector({
  token: process.env.HATCHET_JWT_TOKEN,
  hostAndPort: 'localhost:7077',  // optional, defaults to localhost:7077
  apiUrl: 'http://localhost:8888', // optional, defaults to http://localhost:8888
  logLevel: 'INFO',                // optional, defaults to INFO
  tenantId: 'your-tenant-id'       // optional
})

// Define a task
class MyTask extends ShouldQueue<{ message: string }> {
  taskName = 'process_message'
  
  async handle(taskBody: { message: string }): Promise<void> {
    console.log('Processing:', taskBody.message)
    // Your task logic here
  }
}

// Create task instance
const myTask = new MyTask({ connector: hatchetConnector })

// Start worker to process tasks
await hatchetConnector.startWorker({
  workerName: 'my-worker',
  tasks: [myTask],
  slots: 100  // concurrent task capacity
})

// Queue a task
const status = await myTask.queue({ message: 'Hello Hatchet!' })
console.log('Task queued:', status.id)

// Check task status
const taskStatus = await myTask.getStatus(status.id)
console.log('Task status:', taskStatus.status)
```

## Key Features

- **Seamless Integration**: Works with Goatlab's task system using Hatchet as the backend
- **Worker Management**: Easy worker creation with configurable concurrency slots
- **Task Status Tracking**: Monitor task execution status and results
- **Retry Support**: Built-in retry mechanism for failed tasks
- **Type Safety**: Full TypeScript support with strongly-typed task payloads

## Configuration Options

- `token` (required): Hatchet JWT authentication token
- `hostAndPort`: Hatchet server address (default: `localhost:7077`)
- `apiUrl`: Hatchet API URL (default: `http://localhost:8888`)
- `logLevel`: Logging verbosity (`INFO`, `OFF`, `DEBUG`, `WARN`, `ERROR`)
- `tenantId`: Hatchet tenant identifier for multi-tenant setups
npm package: @goatlab/tasks-core
Description: Common interfaces to work with tasks
Author: ignacio.cabrera@goatlab.io
Latest version: 0.15.0

# @goatlab/tasks-core

A TypeScript library providing a common interface for creating queueable tasks that can be executed by different task processing backends. This package defines the core abstractions for task queuing, status tracking, and execution handling.

## Installation

```bash
pnpm add @goatlab/tasks-core
```

## Basic Usage

Create a queueable task by extending the `ShouldQueue` abstract class:

```typescript
import { ShouldQueue, TaskConnector } from '@goatlab/tasks-core'

// Define your task input/output types
interface EmailTaskInput {
  to: string
  subject: string
  body: string
}

// Create your task class
class SendEmailTask extends ShouldQueue<EmailTaskInput, void> {
  taskName = 'send-email'
  postUrl = '/api/tasks/send-email'

  async handle(taskBody: EmailTaskInput): Promise<void> {
    // Your task logic here
    await sendEmail(taskBody.to, taskBody.subject, taskBody.body)
  }
}

// Initialize with a connector (e.g., GCP Cloud Tasks, Hatchet, etc.)
const emailTask = new SendEmailTask({
  connector: myTaskConnector,
  basePostUrl: 'https://api.example.com'
})

// Queue the task
const status = await emailTask.queue({
  to: 'user@example.com',
  subject: 'Welcome!',
  body: 'Thanks for signing up'
})

// Check task status
const taskStatus = await emailTask.getStatus(status.id)
```

## Key Features

- **Abstract task interface** - Define queueable tasks with consistent behavior
- **Type-safe** - Full TypeScript support for task inputs and outputs
- **Connector agnostic** - Works with any task backend that implements `TaskConnector`
- **Status tracking** - Monitor task execution with standardized status types
- **Retry support** - Built-in retry configuration for failed tasks
- **Unique task naming** - Override `getUniqueTaskName()` for deduplication
npm package: @goatlab/ts-package-template
Description: Readable query Interface & API generator for TS and Node
Author: ignacio.cabrera@goatlab.io
Latest version: 0.6.0

# @goatlab/ts-package-template

A TypeScript package template for creating new packages in the Goat Fluent monorepo. This template provides a pre-configured setup with TypeScript, Jest, ESLint, and automated release workflows.

## Using this Template

1. Copy the `base_project` directory to a new package:
   ```bash
   cp -r packages/base_project packages/your-package-name
   ```

2. Update `package.json`:
   - Change the `name` field to your package name (e.g., `@goatlab/your-package`)
   - Update the `description` field
   - Remove or update dependencies as needed

3. Start developing in the `src/` directory

## What's Included

- **TypeScript** configuration extending `@goatlab/tsconfig`
- **Jest** setup for testing with ts-jest
- **ESLint** for code linting
- **Prettier** for code formatting
- **Commitizen** for conventional commits
- **Release-it** for automated releases
- **Auto-changelog** generation
- Pre-configured build scripts

## Commands

```bash
# Development
pnpm dev          # Watch mode compilation
pnpm build        # Build the package
pnpm test         # Run tests
pnpm lint         # Run ESLint
pnpm format       # Format code with Prettier

# Release
pnpm release:patch  # Release patch version
pnpm release:minor  # Release minor version
pnpm release:major  # Release major version
```
npm package: @goatlab/tsconfig
Description: Shared TypeScript configuration presets for the Goat Fluent monorepo and related projects.
Latest version: 0.2.0

# @goatlab/tsconfig

Shared TypeScript configuration presets for the Goat Fluent monorepo and related projects.

## Installation

```bash
pnpm add -D @goatlab/tsconfig
```

## Usage

Extend one of the available configurations in your `tsconfig.json`:

```json
{
  "extends": "@goatlab/tsconfig/base.json",
  "compilerOptions": {
    "outDir": "./dist"
  }
}
```

## Available Configurations

- **`base.json`** - Base TypeScript configuration with strict type checking, ES2022 target, and decorator support
- **`internal.json`** - Extends base config for declaration-only builds (generates `.d.ts` files without JavaScript output)
- **`tsconfig.json`** - CommonJS configuration with Node.js types and ts-node support

## Features

- Strict type checking enabled
- Decorator and metadata support for TypeORM/class-based APIs  
- Source maps and incremental compilation
- Path mapping for `@src/*` imports
- Optimized for modern ES2022+ environments