open-index/open-npm huggingface dataset:
npm package: @orion-js/crypto
Description: This project provides utility functions for symmetric and asymmetric encryption, decryption, signing, and hashing. It uses the crypto and bcryptjs libraries for cryptographic operations.
Author: nicolaslopezj
Latest version: 4.3.1

# Orionjs Crypto

This project provides utility functions for symmetric and asymmetric encryption, decryption, signing, and hashing. It uses the crypto and bcryptjs libraries for cryptographic operations.

## Symmetric Encryption

The symmetric encryption module provides functions for generating passwords and for encrypting and decrypting text. This can be used for securely storing sensitive data like user passwords.

```ts
import {symmetric} from './src/utils/symmetric'

const password = symmetric.generatePassword()
const encrypted = symmetric.encrypt('hello world', password)
const decrypted = symmetric.decrypt(encrypted, password)
```

## Asymmetric Encryption

The asymmetric encryption module provides functions for generating key pairs, and for encrypting and decrypting messages. This can be used for secure communication between two parties.

```ts
import {asymmetric} from './src/utils/asymmetric'

const {encryptKey, decryptKey} = asymmetric.generateKeys()
const encrypted = asymmetric.encrypt(encryptKey, 'hello')
const decrypted = asymmetric.decrypt(decryptKey, encrypted)
```

## Signing

The signing module provides functions for signing a payload and for verifying a signed payload. This can be used to ensure the integrity and authenticity of data.

```ts
import {sign} from './src/utils/sign'

const secret = 'my_secret'
const payload = 'hello world'
const checksum = sign.sign(payload, secret)
const isValid = sign.verify(payload, checksum, secret)
```

## Hashing

The hashing module provides functions for creating a hash from a text and for comparing a text with a hash. This can be used for storing sensitive data like passwords in a secure way.

```ts
import {hash} from './src/utils/hash'

const text = 'hello world'
const hashed = hash.hash(text)
const isSame = hash.compare(text, hashed)
```

## Hashing with Salt

The hashing with salt module provides functions for creating a hash from a password with a salt and for comparing a password with a hash. This can be used for storing user passwords in a secure way.

```ts
import {hashWithSalt} from './src/utils/hashWithSalt'

const password = 'password'
const hashed = hashWithSalt.hash(password)
const isSame = hashWithSalt.compare(password, hashed)
```
npm package: @orion-js/env
Description: Orion Env is a utility for managing a collection of secrets in source control. The secrets are encrypted using public key, elliptic curve cryptography.
Author: nicolaslopezj
Latest version: 4.3.1

# Orion Env

Orion Env is a utility for managing a collection of secrets in source control. The secrets are encrypted using public key, elliptic curve cryptography.

> This package works as standlaone package. It does not depend on any other orionjs package.

It's like dotEnv but saved in source control.

## Creating a new Env config file

Run the following script in a project that has the package installed. Save the password output because you will need to use it to decrypt the keys.

    yarn orion-env init --path=<path>

## Adding a new env variable

Run the following script in a project that has the package installed and you will be prompted for the variable name and value.

    yarn orion-env add --path=<path>

## Using in your app

Define the following environment variables (in the old way):

- `ORION_ENV_FILE_PATH=<path>` The path to the env file.
- `ORION_ENV_SECRET_KEY=<password>` The password to decrypt the keys.

Then you can access the variables by importing the package and all the env variables defined will be the env object.

    import {env} from '@orion-js/env'

    env.XX

## Setting environment variables (process.env)

To add backwards compatibility you can also use this libary to set the environment variables.

    import {loadEnv} from '@orion-js/env'

    loadEnv(options)

This will set the environment variables for the current process.

Options:

- `secretKey` Secret password used to decrypt the encrypted env file. Default: process.env.ORION_ENV_SECRET_KEY
- `envFilePath` Location of the file to read. Default: process.env.ORION_ENV_FILE_PATH
- `override` Set to true to set the environment variables even if the variable was already set. Default: process.env.ORION_ENV_OVERRIDE
npm package: @orion-js/typed-model
Description: Allows you to define a class that represents a model. This allows quicker development and better type checking of your models (since all class type definitions can be reused).
Author: dmerrill6
Latest version: 4.3.1

# Typed Model Package

Allows you to define a class that represents a model. This allows quicker development and better type checking of your models (since all class type definitions can be reused).

## Recommended usage example

### Folder structure

```
+-- models/
    +-- user/
        +-- index.ts
        +-- resolvers/
            +-- fullName.ts
```

### Resolver definition

```typescript
// models/user/resolvers/fullName.ts

export const fullNameResolver = async ({firstName, lastName}) => `${firstName} ${lastName}`

export const fullNameSchema = {
  returns: {type: String},
  resolve: fullNameResolver
}
```

### Model definition

```typescript
// models/user/index.ts

import {Prop, Schema, Resolver, getModelForClass} from '@orion-js/typed-model'
import {fullNameSchema, fullNameResolver} from './resolvers/fullName'

@Schema()
export class User {
  @Prop()
  firstName: string

  @Prop({optional: true})
  lastName: string

  @Resolver(fullNameSchema)
  fullName: typeof fullNameResolver
}

export default getModelForClass(User)
```

## Advanced usage

### Schema Extension

Typed-model allows extending an existing Schema to reduce code repetition.

```typescript
import {SchemaFieldTypes} from '@orion-js/schema'

@Schema()
class ModelWithId {
  @Prop({type: SchemaFieldTypes.ID})
  _id: string
}

class ModelWithName extends ModelWithId {
  @Prop()
  name: string
}

export default getModelForClass(ModelWithName)
// Will contain both _id and name props
```
npm package: @orion-monitoring/cli
Description: CLI to initialize an Orion logging project
Latest version: 1.2.5
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @orion-monitoring/cli

Interactive CLI to initialize the [Orion](https://orion.dev) SDK in your project. Authenticates with your Orion account, registers a source, and generates `orion.config.ts`.

## Usage

```bash
npx @orion-monitoring/cli
# or
npx create-orion
```

## What it does

```
1. Sign in to your Orion account     (browser or personal token)
2. Select or create a project
3. Select or create a source         (name, description, environment)
4. Generate SDK token                (scoped to your project + source)
5. Write orion.config.ts             (in the current directory)
```

## Interactive flow

### Authentication

Choose between two methods:

- **Browser (recommended)** — opens your default browser to complete login, then returns automatically to the terminal
- **Personal token** — paste an API token directly

### Project

Select an existing project from the list, or create a new one by providing a display name and a slug identifier.

### Source

A source represents one running instance of your application (e.g. `api-backend`, `worker-queue`). Select an existing source or create a new one:

- **Name** — lowercase, hyphens and digits only (e.g. `api-backend`)
- **Description** — free text (e.g. `Handles the main REST API`)
- **Environment** — `production`, `development`, `staging`, or `test`

### Result

```
Project    : my-project
Source     : api-backend
Config     : /your/project/orion.config.ts
```

## Generated file

```typescript
// orion.config.ts
import { defineConfig } from '@orion-monitoring/sdk'

export default defineConfig({
  token: 'your-sdk-token',
})
```

## Next steps

After running the CLI, install the SDK and start logging:

```bash
npm install @orion-monitoring/sdk
```

```typescript
import { createLogger } from '@orion-monitoring/sdk'

const logger = createLogger()
logger.info('App started')
```

## Requirements

- Node.js >= 18.0.0
- An Orion account and a running Orion API instance

## License

MIT