open-index/open-npm huggingface dataset:
npm package: @josephdadams/usbrelay
Description: Control USB HID Relays from NodeJS.
Author: Joseph Adams
Latest version: 1.0.3

USB Relay
=============

Control simple USB HID Relays using Node JS like this one:

![picture alt](https://github.com/josephdadams/USBRelay/raw/master/usbrelay.jpg "USB Relay")

### To install

```bash
npm i @josephdadams/usbrelay
```

### To use:

```javascript
const USBRelay = require("@josephdadams/usbrelay");
const relay = new USBRelay(); //gets the first connected relay
```

To use a specific relay, specify a HID path:

```javascript
const relay = new USBRelay(path);
```

Get connected relays:

```javascript
USBRelay.Relays; //returns an array with HID data including paths
```

Set relay state:

```javascript
relay.setState(1, true); // turns Relay 1 of the device on
relay.setState(1, false); // turns Relay 1 of the device off
```
Relay numbers are NOT zero-based, so if you want to refer to Relay #1, use 1.

To turn all relays off:

```javascript
relay.setState(0, false); // relay number 0 references all relays of the device
```

To turn a relay on, wait 1 second, and then turn off:

```javascript
relay.setState(1, true);

setTimeout(function () {
    relay.setState(1, false);
}, 1000);
```
npm package: @josephdaw/authenticator
Description: a basic authenticator module for use in a node.js application
Author: Joseph Daw
Latest version: 1.0.2

# Authenticator
[![npm (scoped)](https://img.shields.io/npm/v/%40josephdaw/authenticator?logo=npm)
](https://www.npmjs.com/package/@josephdaw/authenticator)
![GitHub](https://img.shields.io/github/license/josephdaw/authenticator)
[![Node.js CI](https://github.com/josephdaw/authenticator/actions/workflows/node-testing.yml/badge.svg)](https://github.com/josephdaw/authenticator/actions/workflows/node-testing.yml)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)


## Table of Contents
- [Description](#description)
- [Features](#features)
- [Issues and Requests](#issues-and-requests)
- [Security](#security)
- [Contributing](#contributing)
- [Changes](#changelog)
- [License](#license)


## Description
A basic authenticator module for use in a node.js application

## Installation
### Using npm
```bash
npm install @josephdaw/authenticator
```

## Usage
### Importing
```javascript
const [package-name] = require('@josephdaw/authenticator');
```


## Issues and Requests
Please report any bugs or feature requests via [GitHub Issues](https://github.com/josephdaw/authenticator/issues). 

## Security 
Please report any security issues to [dev@josephdaw.com](mailto:dev@josephdaw.com). Find more information in our [Security Policy](.github/SECURITY.md)

## Contributing
All development of this project happens through GitHub. We welcome constructive collaboration from the community to help implement new features or fix bugs. For more information please read our [Contribution Guide](.github/CONTRIBUTING.md)

## Changelog
Every significant change is documented in the [changelog file](CHANGELOG.md). 

## License
This project is released under the [MIT License](LICENSE).
npm package: @josephdaw/http
Description: A very basic, custom http request wrapper
Author: Joseph Daw
Latest version: 1.0.2

# HTTP wrapper
[![npm (scoped)](https://img.shields.io/npm/v/%40josephdaw/http?logo=npm)](https://www.npmjs.com/package/@josephdaw/http)
![GitHub](https://img.shields.io/github/license/josephdaw/http)
[![Node.js CI](https://github.com/josephdaw/http/actions/workflows/node-testing.yml/badge.svg)](https://github.com/josephdaw/http/actions/workflows/node-testing.yml)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)


## Table of Contents
- [Description](#description)
- [Features](#features)
- [Issues and Requests](#issues-and-requests)
- [Security](#security)
- [Contributing](#contributing)
- [Changes](#changelog)
- [License](#license)


## Description
This is a custom http wrapper. This module is to enable the user to absract away the http calls and focus on the data. 

## Installation
### Using npm
```bash
npm install @josephdaw/http
```

## Usage
### Importing
```javascript
const http = require('@josephdaw/http');
```

### GET
```javascript
http.get(url)
    .then((response) => {
        console.log(response);
    })
    .catch((error) => {
        console.log(error);
    });
```


### POST
```javascript
http.post(url, data)
    .then((response) => {
        console.log(response);
    })
    .catch((error) => {
        console.log(error);
    });
```

### PUT
```javascript
http.put(url, data)
    .then((response) => {
        console.log(response);
    })
    .catch((error) => {
        console.log(error);
    });
```

### DELETE
```javascript
http.delete(url)
    .then((response) => {
        console.log(response);
    })
    .catch((error) => {
        console.log(error);
    });
```

## Issues and Requests
Please report any bugs or feature requests via [GitHub Issues](https://github.com/josephdaw/http/issues). 

## Security 
Please report any security issues to [dev@josephdaw.com](mailto:dev@josephdaw.com). Find more information in our [Security Policy](.github/SECURITY.md)

## Contributing
All development of this project happens through GitHub. We welcome constructive collaboration from the community to help implement new features or fix bugs. For more information please read our [Contribution Guide](.github/CONTRIBUTING.md)

## Changelog
Every significant change is documented in the [changelog file](CHANGELOG.md). 

## License
This project is released under the [MIT License](LICENSE).
npm package: @josephdaw/logger
Description: A basic logger for Node.js applications.
Author: Joseph Daw
Latest version: 1.0.4

# Logger
[![npm (scoped)](https://img.shields.io/npm/v/%40josephdaw/logger?logo=npm
)](https://www.npmjs.com/package/@josephdaw/logger)
![GitHub](https://img.shields.io/github/license/josephdaw/logger)
[![Node.js CI](https://github.com/josephdaw/logger/actions/workflows/node-testing.yml/badge.svg)](https://github.com/josephdaw/logger/actions/workflows/node-testing.yml)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)


## Table of Contents
- [Description](#description)
- [Features](#features)
- [Issues and Requests](#issues-and-requests)
- [Security](#security)
- [Contributing](#contributing)
- [Changes](#changelog)
- [License](#license)


## Description
A basic logger for Node.js applications. It has three logger transports set up. The first outputs to the console, the second outputs only errors to a file, and the third outputs down to the info level to a log file. 
The level that the console transport logs to is set by the `LOG_LEVEL` environment variable. If no level is set, it will default to 'info'.

## Installation
### Using npm
```bash
npm install @josephdaw/logger
```

## Usage
### Importing
```javascript
const logger = require('@josephdaw/logger');
```


## Issues and Requests
Please report any bugs or feature requests via [GitHub Issues](https://github.com/josephdaw/logger/issues). 

## Security 
Please report any security issues to [dev@josephdaw.com](mailto:dev@josephdaw.com). Find more information in our [Security Policy](.github/SECURITY.md)

## Contributing
All development of this project happens through GitHub. We welcome constructive collaboration from the community to help implement new features or fix bugs. For more information please read our [Contribution Guide](.github/CONTRIBUTING.md)

## Changelog
Every significant change is documented in the [changelog file](CHANGELOG.md). 

## License
This project is released under the [MIT License](LICENSE).
npm package: @josephdsbr97/spa-checkout-sdk
Description: SPA Checkout library
Latest version: 0.1.0

# spa-checkout

Biblioteca Node.js para SPA Checkout (integração PIX com ms-banking / Pinbank).

## Requisitos

- Node.js >= 18

## Instalação

```bash
npm install
```

## Build

```bash
npm run build
```

Gera os arquivos em `dist/` (JavaScript + declarações TypeScript). Sempre rode o build antes de publicar ou de usar a lib em outro projeto.

Para desenvolvimento com rebuild automático ao salvar:

```bash
npm run build:watch
```

## Uso local no spa-backend (testar sem publicar)

Com os dois projetos no mesmo nível (ex.: `workspace/spa-checkout` e `workspace/spa-backend`):

1. **Buildar a lib** (obrigatório; o backend usa o que está em `dist/`):

   ```bash
   cd /caminho/para/spa-checkout
   npm run build
   ```

2. **Instalar no backend** – no `spa-backend` já está configurado `"spa-checkout": "file:../spa-checkout"`. Rode no backend:

   ```bash
   cd /caminho/para/spa-backend
   npm install
   ```

   O npm vai linkar/copiar a pasta local para `node_modules/spa-checkout`. Sempre que alterar o código da lib, rode de novo `npm run build` na pasta da lib (ou use `npm run build:watch` num terminal e deixe rodando).

**Alternativa com `npm link`** (symlink global; ver o pacote atualizado sem reinstalar):

```bash
# Na pasta da lib (uma vez)
cd spa-checkout
npm run build
npm link

# No backend (uma vez)
cd spa-backend
npm link spa-checkout
```

Depois disso, qualquer `npm run build` em `spa-checkout` já deixa o backend usando a versão nova.

## Uso (API PIX)

Variáveis de ambiente (no app que consome a lib): `MS_BANKING_BASE_URL`, `MS_BANKING_API_KEY`, `MS_BANKING_ORG_ID`, `MS_BANKING_BANK_CODE`, `MS_BANKING_DIGITAL_ACCOUNT_PINBANK_ID`.

```ts
import {
  createPixDepositIntent,
  PixDepositIntentError,
} from 'spa-checkout';

// Criar intenção PIX (externalId = ex.: ID do pedido)
const res = await createPixDepositIntent({
  cpfCnpj: '12345678900',
  value: 130,
  externalId: orderId,
});
// res.base64Path, res.qrCodeText, etc.

// Em caso de erro (4xx/5xx do ms-banking)
catch (err) {
  if (err instanceof PixDepositIntentError) {
    // err.code, err.title, err.status, err.message, err.details
  }
}
```

## Estrutura

```
spa-checkout/
├── src/
│   ├── index.ts
│   ├── config.ts
│   ├── errors.ts
│   ├── pix-deposit-intent.types.ts
│   └── ms-banking-client.ts
├── dist/           # gerado pelo build (não versionar)
├── package.json
├── tsconfig.json
└── README.md
```

## Scripts

| Script | Descrição |
|--------|-----------|
| `npm run build` | Compila TypeScript → `dist/` |
| `npm run build:watch` | Compila e recompila ao salvar |
| `npm run clean` | Remove `dist/` |
| `npm run prepublishOnly` | Roda antes de publicar no npm |