open-index/open-npm huggingface dataset:
npm package: @neurodevs/node-ble-scanner
Description: Scan for Bluetooth Low Energy (BLE) devices
Latest version: 0.7.4

# node-ble-scanner
Scan for Bluetooth Low Energy (BLE) peripherals

## Installation

Install the package using npm:

```bash
npm install @neurodevs/node-ble-scanner
```

Or yarn:

```bash
yarn add @neurodevs/node-ble-scanner
```

## Usage

### Basic Usage

To scan for specific BLE peripherals by their uuids:

```typescript
import { BleScannerImpl } from '@neurodevs/node-ble-scanner'

async function discoverPeripherals() {
    const uuids = ['uuid-for-your-bluetooth-peripheral']

    const scanner = BleScannerImpl.Create()
    const peripherals = await scanner.scanForPeripherals(uuids)

    console.log('Discovered Peripherals:', peripherals)
}
```

## Testing

For testing, you can replace the `BleScannerImpl` class with test doubles:

```typescript
import {
  BleScannerImpl,
  FakeBleScanner,
  SpyBleScanner
} from '@neurodevs/node-ble-scanner'

// Use for a fake implementation with validations for user interactions
BleScannerImpl.Class = FakeBleScanner

// Use to test real behavior with enhanced internal visibility
BleScannerImpl.Class = SpyBleScanner

const scanner = BleScannerImpl.Create()
```

If you use the `SpyBleScanner` test double (or any other test double you create which extends `BleScannerImpl`), then it will use the real `noble` library unless otherwise set, which is an open-source package that manages the lower-level Bluetooth connection.

You can also fake `noble` so that you do not require actual BLE hardware in your tests:

```typescript
import {
    BleScannerImpl,
    FakeNoble,
} from '@neurodevs/node-ble-scanner'

BleScannerImpl.noble = new FakeNoble()

const scanner = BleScannerImpl.Create()
```
npm package: @neurodevs/node-csv-loader
Description: Load a CSV file
Latest version: 0.2.4

# node-csv-loader

A simple CSV file loader

## Installation

Install the package using npm:

`npm install @neurodevs/node-csv-loader`

Or yarn:

`yarn add @neurodevs/node-csv-loader`

## Usage

### Basic Usage

To load a CSV file:

```typescript
import { CsvLoaderImpl } from '@neurodevs/node-csv-loader'

async function loadCsv() {
  const loader = CsvLoaderImpl.Create()
  const data = await loader.load('/path/to/csv')
  console.log(data)
}
```

### Disable Path Validation

This class automatically performs the following validations on the path you pass to the load method:

- Asserts that you passed a path
- Asserts that the file exists at the path
- Asserts that the file extension is '.csv'

To turn off path validation (e.g., when you are certain of the file's existence or extension):

```typescript
import { CsvLoaderImpl } from '@neurodevs/node-csv-loader'

const loader = CsvLoaderImpl.Create({ shouldValidatePath: false })
```

## Testing

You can use the following test doubles for unit testing purposes:

```typescript
import {
  CsvLoaderImpl,
  FakeCsvLoader,
  SpyCsvLoader
} from '@neurodevs/node-csv-loader'

// Use FakeCsvLoader for simulating inputs and outputs in tests
CsvLoaderImpl.Class = FakeCsvLoader

// Use SpyCsvLoader to test real behavior with enhanced internal visibility
CsvLoaderImpl.Class = SpyCsvLoader

const loader = CsvLoaderImpl.Create()
```

- **`FakeCsvLoader`**: Provides a fake implementation to simulate CSV loading for testing.
- **`SpyCsvLoader`**: Wraps the real implementation with enhanced visibility for inspecting internal behavior during testing.
npm package: @neurodevs/node-file-checker
Description: Check whether files exist with timeout
Latest version: 0.3.10

# node-file-checker
Check whether file exists with optional timeout

## Installation

`npm install @neurodevs/node-file-checker`

## Static Creation Method

```typescript
import { FileCheckerImpl } from '@neurodevs/node-file-checker'

const checker = FileCheckerImpl.Checker()
```

## Check If File Exists

```typescript
import { FileCheckerImpl } from '@neurodevs/node-file-checker'

const path = '...'
const checker = FileCheckerImpl.Checker()

// Needs to be in an async function
const wasFound = await checker.checkIfFileExists(path)
```

## Check with a Timeout (Default: No timeout)

```typescript
import { FileCheckerImpl } from '@neurodevs/node-file-checker'

const path = '...'
const timeoutMs = 1000

const checker = FileCheckerImpl.Checker({ timeoutMs })

// Needs to be in an async function
const wasFound = await checker.checkIfFileExists(path)
```


## Use a Test Double in Your Tests

```typescript
import { FileCheckerImpl, FakeFileChecker } from '@neurodevs/node-file-checker'

FileCheckerImpl.Class = FakeFileChecker
const fakeChecker = FileCheckerImpl.Checker()
```

## Create Your Own Test Double

```typescript
import { FileChecker } from '@neurodevs/node-file-checker'

class MockFileChecker implements FileChecker {
    ...
}

FileCheckerImpl.Class = MockFileChecker
const mockChecker = FileCheckerImpl.Checker()
```
npm package: @neurodevs/node-knowledge-graphs
Description: Build and manipulate knowledge graphs in Node
Latest version: 0.12.0

# node-knowledge-graphs
Build and manipulate knowledge graphs in Node.js

## Current feature list

- BinaryDirectedGraph
  - addNode
  - hasNode
  - getNode
  - getNodes
  - addEdge (manages in/outDegree of nodes)
  - hasEdge
  - getEdges
  - toAdjacencyMatrix

- AdjacencyMatrix
  - getMatrix
  - getLabels

- DirectedNode
  - inDegree
  - outDegree

## Next features to develop

- getEdge
- addNodes
- addEdges
- removeNode
- removeNodes
- removeEdge
- removeEdges
- Get neighbors of node
- Get degree distribution of graph
- Get assortativity of graph
- Get degree balance of directed node (ratio of inDegree to outDegree)
- Define paths and path length
- Define cycles
- Define walks
- Get isConnected of graph (paths exist between all nodes)
- Get distance between nodes
- Get distance matrix of graph
- Get graph diameter (global maximum of the distance matrix)