open-index/open-npm huggingface dataset:
npm package: @jlarge11/tcpip-mon
Description: Simple proxy that logs TCP/IP requests and responses before forwarding
Author: Justin Large
Latest version: 1.0.0

# tcpip-mon
This is a simple proxy that logs TCP/IP REST requests and responses before forwarding.  It currently only supports JSON inputs and outputs.  It's implemented as a CLI, and it takes in the following inputs...
* `localPort`:  The port that this CLI proxy will listen to on the local machine.
* `destinationUrl`:  The location of the REST API where we want inputs and outputs logged.

# Installation
To install, you need to have `npm` installed.  This was tested on Node `v17.0.1` and NPM `8.1.0`.  Once you have NPM, run the following:  `npm install -g @jlarge11/tcpip-mon`.

# Usage
`tcpip-mon <localPort> <destinationUrl>`.  When you're finished, just use `Ctrl-C`.

# Publishing a new version
To publish a new version, run `./deploy <versionType>`, where `versionType` is `major`, `minor`, or `patch`.  Only the `jlarge11` account on npmjs.com is authorized to publish.  This script will do the following...
* Modify, commit, and push the version change to `package.json` and `package-lock.json`.
* Create and push a tag for the new version.
* Publish the new version to NPM under `@jlarge11/tcpip-mon`.
npm package: @jlcara/prettier-config
Description: Shared Prettier config
Author: Jose Luis Martin Cara
Latest version: 1.0.0

# Shared Prettier configuration

This shared [Prettier](https://prettier.io/) configuration changes some of the default behavior.

## Integrate into new project

1. Install this package as devDependency

```sh
# with npm
$ npm i -D @jlcara/prettier-config

# with pnpm
$ pnpm add -D @jlcara/prettier-config
```

2. Install peer dependencies of this package in your project as devDependencies

Therefore, you can make use of the tool [install-peerdeps](https://github.com/nathanhleung/install-peerdeps):

```sh
# with Yarn
$ yarn dlx install-peerdeps --dev @jlcara/prettier-config

# with npm
$ npx install-peerdeps --dev @jlcara/prettier-config

#with pnpm
$ pnpm dlx install-peerdeps --dev @jlcara/prettier-config
```

3. Use Prettier config in your project

Create a `.prettierrc` file in project root with the following content:

```
"@jlcara/prettier-config"
```
npm package: @jlcarveth/auth.js
Description: A Jsonwebtoken and node:crypto wrapper
Author: John L. Carveth
Latest version: 2.1.0

# auth.js
![npm](https://img.shields.io/npm/dt/@jlcarveth/auth.js) ![npm (scoped)](https://img.shields.io/npm/v/@jlcarveth/auth.js) ![GitHub](https://img.shields.io/github/license/jlcarveth/auth.ts)

`auth.js` is a Node.js module that provides several functions for handling authentication and security in a Node.js application. It uses the `jsonwebtoken` library to generate and verify JSON Web Tokens (JWTs) and the Node.js `crypto` library to generate salts and hash passwords.

## Installation

Simply install the package from npm:
```
npm i @jlcarveth/auth.js
```

## Usage
 `auth.js` requires a `SECRET_KEY` environment variable to be defined. You can generate one with the following command: `openssl rand -base64 32`
To use the functions provided by `auth.js`, you need to import them into your code. Here's an example of how you might use the `generateToken` function to create a new JWT:

```javascript
import { generateToken } from "@jlcarveth/auth.js";

async function createToken() {
  const token = await generateToken({ email: 'user@example.com', role: 'admin' });
  console.log(token);
}
```

In this example, we import the `generateToken` function from the `auth.js` module and use it to create a new token for a user with the email address `user@example.com` and the role `admin`.

## Configuration

The `auth.js` module uses a secret key to sign JWTs. This key should be set as an environment variable named `SECRET_KEY`. Make sure to use a strong and unique secret key to prevent attackers from forging tokens.

## API

The `auth.js` module exports the following functions:

### generateToken(payload)

Generates a new JWT with the given payload. The payload should be an object, usually containing relevant information about the user requesting the token, such as an email address or role information.

### verifyToken(token)

Verifies the given JWT and returns its payload if it is valid. Throws an error if the token is invalid or expired.

### generateSalt()

Generates a new salt string for hashing passwords.

### hashPassword(password)

Hashes the given password using a randomly generated salt and returns the resulting hash.

### hashWithSalt(password, salt)

Hashes the given password using the specified salt and returns the resulting hash.

### comparePassword(password, hash)

Compares the given plaintext password with the given hash and returns `true` if they match, or `false` otherwise.

### middleware(request, response, next)

Express middleware function that verifies the JWT provided in the request's `x-access-token` header or `token` cookie. If the token is valid, it sets the `email` and `role` properties of the `response.locals` object and calls the `next` function. If the token is invalid or not provided, it sends an error response.

## License

[MIT](LICENSE)