open-index/open-npm huggingface dataset:
npm package: @stellar-expert/claimable-balance-utils
Description: Utilities for Stellar claimable balances
Author: orbitlens
Latest version: 1.4.1

# @stellar-expert/claimable-balance-utils

> Utilities for Stellar claimable balances

## Usage

---

### `getClaimableBalanceClaimStatus(claimant, pointInTime)`

Detects the status of a claimable balance at any given point in time based on claim conditions.

- `claimant` {Claimant} - Claimant condition with destination and predicate
- `pointInTime` {String|Date} - Specific point in time (`now` by default)

Returns of `'available'|'pending'|'expired'|'unfeasible'`

---

### `xdrParseClaimant(claimant)`

Parses claimable balance condition and return formatted human-friendly predicate.

- `claimant` {Claimant} - Claimant condition with destination and predicate

Returns `{{predicate: String, destination: String}}`
npm package: @stellar-expert/eslint-config-js
Description: StellarExpert coding style conventions for JS projects
Author: team@stellar.expert
Latest version: 1.1.0

# @stellar-expert/eslint-config-js

Basic StellarExpert ESLint config for JS projects

## Usage

1. Install package  

    ```
    npm i -D github:stellar-expert/eslint-config-js
    ```

2. Create `.eslintrc.js` file in the project root  

    ```js
    module.exports = {
        //utilize this ESLint config
        extends: ['@stellar-expert/eslint-config-js'],
        //provide paths to ignore
        ignorePatterns: ['distr/', 'node_modules/'],
        //define project-specific globals if any
        globals: {},
        //ovveride some rules if needed
        rules: {
            'no-console': 'off'
        }
    }
    ```

3. Have fun 🚀
npm package: @stellar-expert/eslint-config-react
Description: StellarExpert coding style conventions for React web apps
Author: team@stellar.expert
Latest version: 1.1.0

# @stellar-expert/eslint-config-react

> Basic StellarExpert ESLint conventions for React web apps 

## Usage

1. Install package

    ```
    npm i -D @stellar-expert/eslint-config-react
    ```

2. Create `.eslintrc.js` file in the project root

    ```js
    module.exports = {
        //utilize this ESLint config
        extends: ['@stellar-expert/eslint-config-react'],
        //provide paths to ignore
        ignorePatterns: ['distr/', 'node_modules/'],
        //define project-specific globals if any
        globals: {},
        //ovveride some rules if needed
        rules: {
            'react/no-typos': 'error'
        }
    }
    ```

3. Have fun 🚀
npm package: @stellar-expert/formatter
Description: Formatting utils and common formats for numeric, string, timestamp and binary data
Author: orbitlens
Latest version: 3.0.0

# @stellar-expert/formatter

## Installation

```
npm i @stellar-expert/formatter
```

## Usage

### Stroops representation

`fromStroops(valueInStroops)` - Convert value in stroops (Int64 amount) to the normal string representation

`toStroops(value)` - Convert arbitrary stringified amount to Int64 representation

### Number formatting

`formatWithPrecision(value, precision = 7, separator = ',')` - Format a number with specified precision and decimals separator

`formatWithAutoPrecision(value, separator = ',')` - Format a number using automatically determined precision and decimals separator

`formatWithAbbreviation(value, decimals = 2)` - Convert a number to a human-readable format using abbreviation

`formatWithGrouping(value, group)` - Format a number with rounding to specific precision group

`formatPrice(value, significantDigits = 4)` - Format a number as price with specified significant digits precision

`adjustPrecision(amount)` - Format amount according to default Stellar precision

`approximatePrice(price)` - Convert rational price representation to float-point number

`isValidInt64Amount(value, denominate = true, nonZero = false)` - Check if a provided value can be safely used as token amount in Stellar
operations

### String truncation

`shortenString(value, symbols = 8)` - Truncate strings longer than N symbols replacing characters in the middle with ellipsis

`stripTrailingZeros(value)` - Remove trailing zero symbols from a formatted numeric string

### Date formatting

`normalizeDate(date, autoUnixFormatDetection = true)` - Convert any timestamp representation to a valid date format

`toUnixTimestamp(date)` - Convert date to a numeric UNIX timestamp representation

`formatDateUTC(date)` - Convert date to ISO-like human-readable format

## Testing

Run `jest` with `--experimental-vm-modules` NodeJS flag.
npm package: @stellar-expert/horizon-streamer
Description: Streaming wrapper for Stellar Horizon
Author: StellarExpertTeam
Latest version: 0.1.1

# Horizon Streamer

Streaming wrapper for Stellar Horizon server.


## Usage

Install the package. 

```
npm install -S @stellar-expert/horizon-streamer
```

Stream effects.

```js
import horizonStreamer from '@stellar-expert/horizon-streamer'
import {Server} from 'stellar-sdk'

const horizon = new Server('https://horizon.stellar.org/')

const finalize = horizonStreamer({
    //any horizon call builder which supports streaming
    callBuilder: horizon.effects(),
    //cursor to start from, live blank to stream from the start or use 'now' to start from the most recent record 
    cursor: '12884905985-3', 
    //callback handler that returns fetched entries one by one
    onNewRecord: function (entry) {
        console.log(entry)
        return Promise.resolve()
    }
})

//destroy the streamer when finished
setTimeout(() => finalize(), 1000)
```

## Tests

```
npm run test
```
npm package: @stellar-expert/lib-webpack-template
Description: Webpack+Babel building system for StellarExpert utility libraries
Author: team@stellar.expert
Latest version: 1.0.2

# @stellar-expert/lib-webpack-template

> Webpack+Babel building system for StellarExpert utility libraries

### Installation

```shell
npm i -D @stellar-expert/lib-webpack-template webpack-cli
```

### Usage

#### Babel configuration

Create file `babel.config.js` in the project root:

```js
const {createBabelConfig} = require('@stellar-expert/lib-webpack-template')

module.exports = createBabelConfig()
//or add additional plugins (only if needed)
module.exports = createBabelConfig([
    ['@babel/plugin-proposal-class-properties', {loose: true}]
])
```

#### Webpack configuration

Create file `webpack-config.js` in the project root:

```js
const path = require('path')
const {initWebpackConfig} = require('@stellar-expert/lib-webpack-template')

module.exports = initWebpackConfig({
    libName: 'libUniqueName',
    inputPath: './index.js',
    outputPath: './lib'
})

```

#### Build scripts

Add the following two script entries to the project's `package.json`:

```json
{
  
  "scripts": {
    "build": "webpack --mode=production --config ./webpack-config.js"
  }
}
```

#### PNPM support

For this building system to properly work with `pnpm` package manager, it is required to create `.npmrc` file in the project root.

```
auto-install-peers=true
shamefully-hoist=true
```

### Finding duplicates (optional)

```shell
npm i -D inspectpack
```

If you have `inspectpack` package installed, duplicates will be detected automatically.
npm package: @stellar-expert/webpack-template
Description: Webpack+Babel building system for StellarExpert React-based UI projects
Author: orbit@stellar.expert
Latest version: 1.5.1

# @stellar-expert/webpack-template

> Webpack+Babel building system for StellarExpert React-based UI projects

### Installation

```shell
npm i -D @stellar-expert/webpack-template webpack-cli webpack-dev-server
```

### Usage

#### Babel configuration

Create file `babel.config.js` in the project root.

```js
const {createBabelConfig} = require('@stellar-expert/webpack-template')

module.exports = createBabelConfig()
//or add additional plugins (only if needed)
module.exports = createBabelConfig([
    ['@babel/plugin-proposal-class-properties', {loose: true}]
])
```

#### Webpack configuration

Create file `webpack-config.js` in the project root.

```js
const path = require('path')
const {initWebpackConfig} = require('@stellar-expert/webpack-template')

module.exports = initWebpackConfig({
    entries: {
        app: {
            import: path.join(__dirname, './app.js'),
            htmlTemplate: './static-template/index.html'
        }
    },
    outputPath: './public/',
    staticFilesPath: './static/',
    scss: {
        additionalData: '@import "~@stellar-expert/ui-framework/basic-styles/variables.scss";'
    },
    define: {
        appVersion: pkgInfo.version
    },
    devServer: {
        host: '0.0.0.0',
        https: true,
        port: 9001
    }
})

```

#### Build scripts

Add the following two script entries to the project's `package.json`

```json
{
  ...
  "scripts": {
    "build": "webpack --mode=production --config ./webpack-config.js",
    "dev-server": "webpack serve --mode development --config ./webpack-config.js"
    ...
  }
  ...
}
```

#### PNPM support

For this building system to properly work with `pnpm` package manager,
it is required to create `.npmrc` file in the project root.

```
auto-install-peers=true
shamefully-hoist=true
```

### Finding duplicates (optional)

```shell
npm i -D inspectpack
```

If you have `inspectpack` package installed, duplicates will be detected
automatically.