open-index/open-npm huggingface dataset:
npm package: @mamunonweb/json-db
Description: A JSON database
Author: Al Mamun
Latest version: 1.0.0

# json-db

A JSON database

```
npm i @mamunonweb/json-db
```

## Read

```js
import db from '@mamunonweb/json-db'

await db.read()

console.log(db.data)
```

## Write

```js
import db from '@mamunonweb/json-db'

db.data = {
  msg: 'hello',
}

await db.write()
```

## Read & Write

```js
import db from '@mamunonweb/json-db'

await db.read()

db.data.count++

await db.write()
```

## Configure JSON file

```js
import db from '@mamunonweb/json-db'

db.config.file = './file.json' // default: ./db.json

await db.read()

console.log(db.data)
```
npm package: @man-es/ngx-chain-functional-guards
Description: An Angular guard that executes functional guards in a serial manner, waiting for each one to complete before proceeding to the next.
Author: MAN Energy Solutions SE
Latest version: 19.0.1
Deprecated: Please use @everllence/ngx-chain-functional-guards instead. This package will no longer receive updates or support.

<p style="text-align: center;">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/man-es/ngx-tools/master/images/man-es-ngx-tools-dark.svg">
    <img alt="MAN-ES NGX · Tools" src="https://raw.githubusercontent.com/man-es/ngx-tools/master/images/man-es-ngx-tools-light.svg" width="100%">
  </picture>
</p>

<div style="text-align: center;">

[![License](https://img.shields.io/npm/l/@man-es%2Fngx-chain-functional-guards.svg?style=flat-square)]()
[![npm version](https://badge.fury.io/js/@man-es%2Fngx-chain-functional-guards.svg)]()
[![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)]()

</div>

<hr>

# Ngx Chain Functional Guards

Ngx Chain Functional Guards is a small library that exposes two functions **chainActivationGuards**  and **chainDeactivationGuards**. Both of these functions allow to run guards in a serial manner, waiting for each one to complete before proceeding to the next.

## Installation

Requires the following peer dependencies:

- @angular/core  (>= 19.0.0)
- @angular/router  (>= 19.0.0)
- rxjs (>= 7.0.0)


## Example
### canActivate, canActivateChild
```ts
import { chainActivationGuards } from 'ngx-chain-functional-guards';

// In the route config:
{
  path: '...',
  // chain the desired guards
  canActivate: [chainActivationGuards([SomeGuard1, SomeGuard2, ...])],
  ...
}
```

### canDeactivate

```ts
import { chainDeactivationGuards } from 'ngx-chain-guards';

// In the route config:
{
  path: '...',
  // chain the desired guards
  canDeactivate: [chainDeactivationGuards([SomeGuard1, SomeGuard2, ...])],
}
```

## API
### CanActivateChildFn, CanActivateFn
The **chainActivationGuards** function lets you add an array of guards to be executed in a serial manner.

```typescript
export declare function chainActivationGuards(guards: CanActivateFn[] | CanActivateChildFn[]): CanActivateFn | CanActivateChildFn
```

### CanDeactivateFn
The **chainDeactivationGuards** function lets you add an array of guards to be executed in a serial manner.

```typescript
export declare function chainDeactivationGuards(guards: CanDeactivateFn<never>[]): CanDeactivateFn<never>
```