open-index/open-npm huggingface dataset:
npm package: @samnoh/react-gen
Description: React component generator
Author: Sam Noh
Latest version: 1.1.0

# React Code Generator

<div align="center">
<a href="https://www.npmjs.com/package/@samnoh/react-gen"><img src="https://img.shields.io/npm/v/%40samnoh%2Freact-gen"></a> <a href="https://github.com/samnoh/react-code-generator/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/%40samnoh%2Freact-gen"></a>
</div>

## Install

```bash
npm install -g @samnoh/react-gen
```

## Usage

-   Create a class-based 'Button' jsx component in the '/src' directory

```bash
reactgen -o /src -n Button -c
```

-   Create a functional 'AuthTemplate' tsx component in the default directory

```bash
reactgen -n AuthTemplate -t
```

-   Create a functional 'NavBar' jsx component in the default directory using your own template, `Template.js`

```bash
reactgen -T Template.js -n NavBar
```

## Config

-   You can set default values in `package.json`
    -   `template` configuration is used to set your own template variables

```json
"config": {
    "reactgen": {
        "defaultName": "Component",
        "baseDir": "src",
        "modules": {
            "styled": "styled-components",
            "{ Link }": "react-router-dom"
        },
        "typescript": false,
        "classBased": false,
        "template": {
            "LAZY": "React.lazy(() => import(''));",
            "USEEFFECT": "useEffect(() => {}, []);"
        }
    }
}
```

## Your own template

-   `TEMPLATE_NAME` and `MODULES` are preset template variables

```js
import React, { useEffect } from 'react';
import PageTemplate from 'components/PageTemplate';
MODULES

const  = LAZY
const  = LAZY

const TEMPLATE_NAME = () => {
    USEEFFECT

    return <PageTemplate></PageTemplate>;
};

export default TEMPLATE_NAME;
```

```bash
reactgen -n SideBar -T /templates/test.js -o /components
```

-   Result

```js
import React, { useEffect } from 'react';
import PageTemplate from 'components/PageTemplate';
import styled from 'styled-components';
import { Link } from 'react-router-dom';

const  = React.lazy(() => import(''));
const  = React.lazy(() => import(''));

const SideBar = () => {
    useEffect(() => {}, []);

    return <PageTemplate></PageTemplate>;
};

export default SideBar;
```
npm package: @samocodes/s3-safe-key
Description: Package that sanitizes s3 object keys
Author: Samir
Latest version: 1.1.11

# Object Keys Sanitizer 💉

This utility provides a function to sanitize S3 keys by removing or replacing unsafe characters. It ensures that the keys only contain safe characters, defined as `A-Za-z0-9!-_.'()`.

## Installation 📦

To use this utility, you need to install this package.

```bash
npm install @samocodes/s3-safe-key
pnpm add @samocodes/s3-safe-key
yarn add @samocodes/s3-safe-key
bun add @samocodes/s3-safe-key
```

## Usage 🧰

### Importing the Function

To use the `sanitize` function, first import it into your project:

```typescript
import { sanitize } from "@samocodes/s3-safe-key";
```

`sanitize(key: string, options: Options): string`

- key (string): The key to be sanitized.
- options (Optional): An object with the following optional properties:
  - replacement (string): The string to replace unsafe characters with. Default is an empty string ("").
  - strict (boolean): If true, includes \* and / as safe characters. Default is false.

Returns:

A sanitized string with only safe characters. If the resulting string is empty, it returns a random hexadecimal string of 10 bytes.

## Example

```typescript
import { sanitize } from "@samocodes/s3-safe-key";

const key = "/example/key/with unsafe*characters?";
const options = { replacement: "_", strict: true };

const sanitizedKey = sanitize(key, options);

console.log(sanitizedKey); // Output: example_key_with_unsafe_characters_
```

## Contributing 🤝

Feel free to fork the repository and submit pull requests. For major changes, please open an issue first to discuss what you would like to change.

## License 📜

This project is licensed under the MIT License.

This README covers the usage, API documentation and installation guide.
`https://github.com/samocodes/s3-safe-key.git`
npm package: @samofprog/corekit
Description: Shared NestJS utilities — error handling, structured logging, and more.
Author: Samuel Assemien
Latest version: 1.0.0

# @samofprog/corekit

Shared NestJS utilities — error handling, structured logging, and more.

[![CI](https://github.com/samofprog/corekit/actions/workflows/ci.yml/badge.svg)](https://github.com/samofprog/corekit/actions/workflows/ci.yml)
[![npm](https://img.shields.io/npm/v/@samofprog/corekit)](https://www.npmjs.com/package/@samofprog/corekit)

## Installation

```bash
yarn add @samofprog/corekit
```

### Peer dependencies

```bash
yarn add @nestjs/common axios
```

> `axios` is optional — only required if you use the Axios error utilities.

## Usage

### Error handling

```ts
import {
    getErrorMessage,
    getErrorDetails,
    getErrorDetail,
    isAxiosError,
    isTimeoutError,
} from '@samofprog/corekit';

try {
    await axios.get('/api/users');
} catch (error) {
    // Human-readable message (appends response data for Axios errors)
    const message = getErrorMessage(error);

    // Message + stack trace
    const { message, stack } = getErrorDetails(error);

    // Full structured detail (status, code, data, stack)
    const detail = getErrorDetail(error);

    // Type guards
    if (isAxiosError(error)) {
        console.log(error.response?.status);
    }

    if (isTimeoutError(error)) {
        // retry logic
    }
}
```

### Structured logging

```ts
import { Logger } from '@nestjs/common';
import { log, warn, error as logError } from '@samofprog/corekit';

const logger = new Logger('OrderService');

// Appends cleaned JSON data to the log message
log(logger, 'Order created', { orderId: 'ORD-42', total: 99.99 });
// => [OrderService] Order created {"orderId":"ORD-42","total":99.99}

// Null and undefined values are automatically stripped
warn(logger, 'Missing field', { email: null, name: 'Alice' });
// => [OrderService] Missing field {"name":"Alice"}

// Error with stack trace
logError(logger, 'Payment failed', { orderId: 'ORD-42' }, err.stack);
```

## API

### Error utilities

| Function | Description |
| --- | --- |
| `getErrorMessage(error)` | Human-readable message from any error type |
| `getErrorDetails(error)` | Message + optional stack trace |
| `getErrorDetail(error)` | Full structured `ErrorDetail` object |
| `isAxiosError(error)` | Type guard for Axios-like errors (duck-typed) |
| `isTimeoutError(error)` | Detects timeout errors |

### Logger utilities

| Function | Description |
| --- | --- |
| `log(logger, message, data?)` | Info level |
| `debug(logger, message, data?)` | Debug level |
| `warn(logger, message, data?)` | Warning level |
| `error(logger, message, data?, stack?)` | Error level with optional stack |

### Types

```ts
import type { ErrorDetail, AxiosLikeError, LogData } from '@samofprog/corekit';
```

## License

[MIT](./LICENCE)
npm package: @samokat/abstract-env
Description: This in companion of [parcel-plugin-real-env](https://github.com/samokat-oss/parcel-plugin-real-env). It just wraps global *env* variable for safty using configuration.
Author: Igor Kamyshev
Latest version: 1.1.1

# abstract-env

This in companion of [parcel-plugin-real-env](https://github.com/samokat-oss/parcel-plugin-real-env). It just wraps global *env* variable for safty using configuration.

## TL;DR

```
yarn add @samokat/abstarct-env
```

```js
// config.js

import { createConfig } from '@samokat/abstarct-env'

const config = createConfig({
  API_URL: 'fallback-for-empty-var',
})

const apiUrl = config('API_URL')
```

## Details

Library provides two way for creating configuration: `createConfig` (throws Error for empty value) and `createOptionalConfig` (returns [Option](https://github.com/igorkamyshev/nanoption/) for every value).

Both creators accept fallback values as first agrument and optional name of global config store (default is `_env_`) as second.

Example with simple creator:

```js
// config.js

import { createConfig } from '@samokat/abstarct-env'

const config = createConfig({
  API_URL: 'fallback-for-empty-var',
}, '_custom_variable_in_global_scope_')

const apiUrl = config('API_URL') // 'fallback-for-empty-var'
```

Example with optional creator:

```js
// config.js

import { createOptionalConfig } from '@samokat/abstarct-env'

const config = createOptionalConfig({}, '_custom_variable_in_global_scope_')

const apiUrl = config('API_URL') // Option<string>
apiUrl.isEmpty() // true
```

## Common usage

In common project we use [Parcel](http://parceljs.org/) as bundler, and it can pass env variables to application in dev mode.

```js
// config.js

import { createConfig } from '@samokat/abstarct-env'

const config = createConfig({
  // In dev mode we accept current env variable
  // In prod mode it will be empty
  // and we accept value from global store, injected by external forces
  API_URL: process.env.API_URL,
})

const apiUrl = config('API_URL')
```
npm package: @samokat/lint-release
Description: Lint tool for compare version in git branch and package.json
Author: Igor Kamyshev
Latest version: 1.0.0

# lint-version

> Lint tool for compare version in git branch and package.json

## TL;DR

Just install and start using. 😎

```
yarn add @samokat/lint-release --dev

yarn lint-release
```

## What?

We store application version in `package.json` file and [create separate git branch for every release](https://trunkbaseddevelopment.com). This tool enforce similar versions in two source.

In allows branches with names satisfying pattern `release/X.X.X` and strictly compare it with a version in `package.json`.

### Examples

|package.json version|branch name    |result |
|:------------------ |:------------- |:-----:|
|1.0.0               |master         |✅     |
|2.2.0               |development    |✅     |
|1.0.0               |feature/tl-12  |✅     |
|2.2.0               |release/2.2.0  |✅     |
|2.2.0               |release/2.2.1  |🛑     |
|1.0.0               |release/2.2.0  |🛑     |

## How?

You can use in tool on CI, or add git-hook for linting.

### CI specific

In some cases, on CI we can't use `git` for retriving branch name and CI provide it in env variables. This tool supports specific args for that case.

**Example**
If your CI provide `BRANCH_NAME` variable, you can just pass it to linter:
```
yarn lint-release --branch=$BRANCH_NAME
```

### Husky example

Never allow commit with different versions in branch and `package.json`.

```json
{
  // ...
  "husky": {
    "hooks": {
      "pre-commit": "yarn lint-release",
    }
  },
  // ...
}
```
npm package: @samokat/nest-logger
Description: Provides simple NestJS-module to create logs in cool, grafana-friendly format.
Author: Igor Kamyshev
Latest version: 1.2.1

# nest-logger

Provides simple NestJS-module to create logs in cool, grafana-friendly format.

Why this library:

+ simple way — common NestJS module
+ uniform — json can be parsed from `stdin`/`stderr`
+ trace_id — it provides uniq id for every request

## Usage

Install it
```
yarn add @samokat/nest-logger
```

Add it to `AppModule`
```ts
// app.module.ts
import { Module, NestModule } from '@nestjs/common';
import { LoggerModule } from '@samokat/nest-logger';

@Module({
  imports: [
    LoggerModule.forRoot('my-favorite-project'),
  ],
})
export class AppModule implements NestModule {
  public configure() {
    // pass
  }
}
```

Setup TraceId genrator:

```ts
// main.ts
import { NestFactory } from '@nestjs/core';
import { expressMiddleware } from 'cls-rtracer';
import { AppModule } from './app.module';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  app.use(expressMiddleware());

  await app.listen(3000);
}

bootstrap();
```

Use it in any place of your app
```ts
// any-file.ts
import { Logger } from '@samokat/nest-logger';

@Injectable()
export class AnyService {
  constructor(
    private readonly logger: Logger,
  ) {}

  async doAnything(someData: any): Promise<void> {
    this.logger.log('hello from #doAnything', someData)

    if (someData.length === 0) {
      this.logger.error('error =(', someData)
    }
  }
}
```

## Details

### TraceID Generation

Every log bounded for request, it can help to trace logs by requests. We use great [cls-rtracer](https://github.com/puzpuzpuz/cls-rtracer) library for generation TraceID, please install and setup it separately. If you using Express-adapter, you should just do [instruction from the first block](#usage). Otherwise, please refer to `cls-rtracer` documentation.
npm package: @samokat/operations-icons
Description: Иконки внутренних продуктов самоката
Latest version: 1.1.0

# Operations Icons 

Иконки внутренних продуктов самоката

## Использование
+ Установи зависимость из npm

```shell
yarn add @samokat/operations-icons
```

+ Используй в коде

```ts
import { People, User } from '@samokat/operations-icons'
```
npm package: @samokat/operations-ui
Description: *Внимание! Это очень ранний релиз. Рекомендуем импользовать его с осторожностью.*
Latest version: 0.6.5

# Samokat Operations UI kit

*Внимание! Это очень ранний релиз. Рекомендуем импользовать его с осторожностью.*

UI-кит для внутренних продуктов Самоката.

## Установка

+ Ставь зависимость из npm

```shell
yarn add @samokat/operations-ui
```

+ Включай в бандл css-файл

```ts
import '@samokat/operations-ui/dist/styles.css'
```

+ Добавь RobotoMono шрифт

```html
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,700&display=swap" rel="stylesheet"> 
```
+ Используй компоненты

```ts
import { Typography } from '@samokat/opearations-io'

const { Text } = Typography

//...

const App = () => {
  return (
    <Text>Здравствуй, UI-кит!</Text>
  )
}

//...
```

+ Восхитительно!


## HowTo: Release

1. Make your changes and commit it
2. Run `yarn s release`
3. Run `git push --follow-tags`
4. Travis will publish it to NPM
5. Brilliant!
npm package: @samokat/parcel-plugin-real-env
Description: It is a really simple plugin.
Author: Igor Kamyshev
Latest version: 1.0.0

# parcel-plugin-real-env

It is a really simple plugin.

Install it:
```
yarn add -D @samokat/parcel-plugin-real-env
```

Modify your html files:

```html
<!-- index.html -->

<!-- ... -->
<script src="#/path-to-any-dir/file-name.env.js"></script>
<!-- ... -->
```

After building you will get something like this (no more hashes 😎):

```html
<!-- index.html -->

<!-- ... -->
<script src="/path-to-any-dir/file-name.env.js"></script>
<!-- ... -->
```

That's all. 

## Why?

Our apps must follow 12 factors, and we inject file with current environment at start application's docker container. This file absent in build-time, the plugin provides way to ignore `*.env.js` files.

## And what?

Common `*.env.js` look like this:

```js
window._env_ = {
  API_URL: "https://some-service-api.samokat.io",
}
```

We don't recommend use this **global** variable directly, because  in development-mode, we have no `*.env.js` files and noone can create this variable. We wrote a simple wrapper for resolve this issue — [abstract-env](https://github.com/samokat-oss/abstract-env), just try it.

Please, pay attention. Your code must loaded strictly **after** `*.env.js` file.

You can use synchronous loading:
```html
<!-- index.html -->

<!-- ... -->
<script src="#/path-to-any-dir/file-name.env.js"></script>
<script src="./app.js"></script>
<!-- ... -->
```

Or, asynchronous loading:
```html
<!-- index.html -->

<!-- ... -->
<script defer src="#/path-to-any-dir/file-name.env.js"></script>
<script defer src="./app.js"></script>
<!-- ... -->
```

Be carefully, if you add **async** attribute, scripts can be executed in other order. Use **defer** and everything will be OK.

## Limitations

This is a really specific library. It transforms only **script** tags in `.html` files, which **src** ends `.env.js` and starts with hash (`#`). If you want more flexible solution, try [parcel-plugin-html-root-syntax](https://github.com/Joe-Withey/parcel-plugin-html-root-syntax).

## Special thanks

Source code of this plugin based on [parcel-plugin-html-root-syntax](https://github.com/Joe-Withey/parcel-plugin-html-root-syntax). We just adapted code for our narrow specificity. Thanks, folks!
npm package: @samooth/explorer
Description: Bitcoin Explorer API Wrapper
Author: Tomás Díaz @samooth
Latest version: 0.3.14

# Explorer JS Wrapper library for Bitcoin SV

## Usage

```
const Explorer = require("@samooth/explorer")

const explorer = new Explorer("main")

```

or

```
import Explorer from "@samooth/explorer"

const explorer = new Explorer("main")

```

#### Endpoints

Currently there are 4 endpoints ( whatsonchain, bitails, electrumx, bsvdirect ) but extra endpoints can be added.

```javascript
let explorer = new Explorer("main")

explorer.endpoints.push( myAPI: {
        main: "https://my.api.tld/",
        test: "https://my.api.tld/",
        headerKey: 'my-api-key'
    })

explorer.api='myAPI'
```

#### Methods

  - status()

  - chainInfo()

  - blockHash()

  - blockHeight()

  - blockList ( height, limit )

  - blockLatest ( hash )

  - blockTransactions ( hash )

  - txHash ( hash )

  - downloadTx ( hash )
  
  - downloadTxOut ( hash, index )

  - broadcast( txhex )

  - broadcastBinary ( txBuf)

  - getOutputData ( hash, outputIndex )

  - getOutputsData ( hash, fromIndex, toIndex ) 

  - merkleProof ( hash )

  - mempoolInfo ()

  - mempoolTxs ()

  - addressInfo ( address )

  - balance ( address )

  - history ( address )

  - utxos ( address )

  - detailScriptHash ( scriptHash )

  - balanceScriptHash ( scriptHash )

  - historyByScriptHash ( scriptHash )

  - utxosByScriptHash ( scriptHash )

  - search ( text )

## Install

---

```javascript
npm install @samooth/explorer
```

## Sample Usage

```javascript
const Explorer = require('@samooth/explorer')

let woc = new Explorer("main", { api: "woc" });
woc.status().then((status) => console.log("woc status:", status))

woc.blockLatest(10)
.then((blk)=>console.log("woc latest:",blk))

woc.blockList("000000000000000005bf29a3bff05d1cbf120d052bdbea6d6b8643eefd44be83")
.then((blk)=>console.log("woc blk list:",blk))


let bitails = new Explorer("main", { api: "bitails" });
bitails.status().then((status) => console.log("bitails status:", status))




```


## Documentation


This library helps manage the following APIs:

[Taal](https://docs.taal.com/core-products/whatsonchain)

[Bitails](https://docs.bitails.io/)


## History

### 0.3.0
 - Change to xior from axios
 - Upgrade to bsv2
 - Support for multiple endpoints
 - Support for binary broadcast


### 0.2.0
- Support Cache, default is true. if you don't want cache, set option `{ enableCache: false }`
- Support ApiKey and rate limit to 3 requests/sec without apiKey.
```
  // with apiKey
  const explorer = new Explorer( 'testnet', { apiKey: 'your api key'}  )
```
```
  // without apiKey
  const explorer = new Explorer( 'testnet' )
```
- Support JSDoc type check.

### 0.1.0
- Initate, Support all API in document.

# License

It is released under the terms of the MIT license.