open-index/open-npm huggingface dataset:
npm package: @horseluke/load-script-promise
Description: Enhancement version of dynamic script file loader for browser, with promise, restrict to load once and simple provider loader
Author: Horse Luke
Latest version: 1.1.0

# load-script-promise

[English](./README.md) | [简体中文](./README.zh-CN.md) 

Enhancement version of dynamic script file loader for browser. New features are:

    - Promise API return
    - Restrict to load same src url only once regarding call load many times
    - Simple provider loader, customizable provider load result detector, and simple infinite recursive provider dependency detection.

This repo is forked and modified from [https://github.com/eldargab/load-script](https://github.com/eldargab/load-script), thanks guys!

The structure and development mode of this repo is compatible with ES Module.

Npm package name is `@horseluke/load-script-promise`.

## Installation

In Browser standalone mode (directly require in html file), just include bundled file from `dist` folder, and then use `loadScriptPromise` Object.

`loadScriptPromise` Object is attached to `window` object in browser.

```
<!-- loadScriptPromise.js is for development -->
<script src="./dist/loadScriptPromise.min.js"></script>
```

More usages and examples can be found in folder `/test/browser-test/cases`.

You can open `/test/browser-test/index.html` to see how it works.

[Other details, please read docs in `doc` folder](./doc/en-US/TOC.md).

## API

[Please read docs in `doc` folder](./doc/en-US/TOC.md).

## Test

This repo use mocha to run test.


## License

MIT
npm package: @horseman/components
Description: Components meant to be used with horseman.io projects
Latest version: 0.1.0

[![CircleCI](https://circleci.com/gh/horseman/horseman.svg?style=svg)](https://circleci.com/gh/horseman/horseman)

# Horseman Components

Helper components for working with CMS's in react.

## Installation

`yarn add @horseman/components`

or

`npm -i @horseman/components`

## Usage

```
import { ComponentName } from '@horseman/components';
```
npm package: @horsty/game-tools
Description: [![Netlify Status](https://api.netlify.com/api/v1/badges/48762823-2dbd-4c5a-b506-0d85de27647d/deploy-status)](https://app.netlify.com/sites/game-tools/deploys)
Author: Horsty - Hue Cyril
Latest version: 0.0.11

# Game Tools Library

[![Netlify Status](https://api.netlify.com/api/v1/badges/48762823-2dbd-4c5a-b506-0d85de27647d/deploy-status)](https://app.netlify.com/sites/game-tools/deploys)

[Game-Tools](https://game-tools.netlify.app/)

## SVG

### Add new svg

if you'r adding new svg, you need to run this cmd to transform svg into react component (for more info see this [Blog - Svgr](https://gregberge.com/fr/blog/svg-to-react-component-with-svgr) or [Git - gregberge/svgr](https://github.com/gregberge/svgr))

```
npm run build:svg
```

### Create svg from img

[Pixels to Svg](https://codepen.io/shshaw/pen/XbxvNj)
npm package: @horsty/library
Description: [![Netlify Status](https://api.netlify.com/api/v1/badges/b9642492-329f-4a7d-b263-4b9cb2688da0/deploy-status)](https://app.netlify.com/sites/youthful-edison-0295f4/deploys)
Author: Horsty - Hue Cyril
Latest version: 0.3.2

# Horsty Library

[![Netlify Status](https://api.netlify.com/api/v1/badges/b9642492-329f-4a7d-b263-4b9cb2688da0/deploy-status)](https://app.netlify.com/sites/youthful-edison-0295f4/deploys)

## SVG

### Add new svg

if you'r adding new svg, you need to run this cmd to transform svg into react component (for more info see this [Blog - Svgr](https://gregberge.com/fr/blog/svg-to-react-component-with-svgr) or [Git - gregberge/svgr](https://github.com/gregberge/svgr))

```
npm run build:svg
```

### Library componant naming #FunFact

Why `Holi` to prefixing component ? It is the contraction of Horsty and Library quite simply. It sound nice like `Holy`, and just use `Hl` wasn't readable enough

# Thanks for helping

- Tuto/Guide from HarveyD -> [Blog](https://blog.harveydelaney.com/creating-your-own-react-component-library/) / [Git](https://github.com/HarveyD/react-component-library)
- Tuto/Guide for Svg integration by gregberge -> [Blog](https://gregberge.com/fr/blog/)
- Very simple breakpoint approach -> [Article Medium](https://medium.com/codeartisan/breakpoints-and-media-queries-in-scss-46e8f551e2f2)
npm package: @hortau/react-native-device-time-format
Description: Get device setting for time format in react-native
Author: Steffen Agger
Latest version: 2.4.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.


# react-native-device-time-format

On mobile devices users have the option to opt in/out, of the systems locale, in regards to 12/24 hour clock format:

![12/24 time format iOS settings](https://i.imgur.com/uLD3onD.jpg)

This package exposes this device setting for iOS & Android.

## Contributions

This package was heavily inspired by [react-native-device-clock-format](https://github.com/brentvatne/react-native-device-clock-format), which is *"no longer actively maintained"*, and only supports iOS.

- React Native: 0.60+ autolinking support - fix by [Tim Kuilman](https://github.com/timkuilman)
- Android: SDK Build Tools version warning - fix by [Tihomir Valkanov](https://github.com/thinklinux)

Thank you 🙏

## Getting started

Install with your preferred package manager:
```
yarn add react-native-device-time-format
```
or
```
npm install react-native-device-time-format --save &&
```

For iOS, install pod:
```
(cd ios/ && pod install)
```

For React Native < `0.60`, run:
```
react-native link react-native-device-time-format
```

Should the automatic linking fail (in case of folder structure mismatch or various other reasons), please follow the [manual installation guide](docs/MANUAL_INSTALLATION.md).

## Usage

Bellow is an example of fetching the hours & minutes string representation from a date, with the device time format (using [moment](https://www.npmjs.com/package/moment) for date/time formatting):

```js
import { is24HourFormat } from '@hortau/react-native-device-time-format'
import moment from 'moment'

/**
 * @function getCurrentHourFormat
 * @param  {Date} date Date to format
 * @return {Promise<string>} formatted string HH:mm / h:mm A, depending on device setting
 */
const getCurrentHourFormat = async (date) => {
  const is24Hour = await is24HourFormat()
  return moment(date).format(is24Hour ? 'HH:mm' : 'h:mm A'))
}
```

All native modules runs asynchronous, I would suggest updating an internal state in your app when `AppState` changes to active.
npm package: @hortau/react-native-svg-web
Description: A web replacement for react-native-svg
Author: Chris Baker
Latest version: 1.0.10
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# react-native-svg-web
[![npm version](https://badge.fury.io/js/react-native-svg-web.svg)](http://badge.fury.io/js/react-native-svg-web)
[![downloads](http://img.shields.io/npm/dm/react-native-svg-web.svg)](https://www.npmjs.com/package/react-native-svg-web)

This package can be used as a drop-in replacement for [react-native-svg](https://github.com/react-native-community/react-native-svg) when targeting the web, or as a mock for [jest](https://github.com/facebook/jest) when testing react-native applications.

### Targeting the Web

Add the following to your webpack configuration:

``` javascript
module.exports = {
  ..., /* the existing configuration */

  resolve: {
    alias: {
      'react-native-svg': 'react-native-svg-web'
    }
  }
};
```

### Mocking with Jest

Add the following to your `package.json`.

``` json
{
  "jest": {
    "setupFiles": [
      "./jest/mocks/react-native-svg.js"
    ]
  }
};
```

And then create a file `./jest/mocks/react-native-svg.js`:

``` javascript
jest.mock('react-native-svg', () => require('react-native-svg-web'));
```
npm package: @hortau/react-web-config
Description: react-native-config for web
Author: Tan Li Hau
Latest version: 2.0.0

# react-web-config

[![npm version](https://badge.fury.io/js/%40hortau%2Freact-web-config.svg)](https://badge.fury.io/js/%40hortau%2Freact-web-config)

[react-native-config](https://github.com/luggit/react-native-config) for Web.
Config variables for React Native apps *and React Native Web apps*

Module to expose config variables to your javascript code in React Native, supporting both iOS and Android *and web*.

### Overview

[react-native-web](https://github.com/necolas/react-native-web) is a project to bring [react-native](https://github.com/facebook/react-native) to the web. [Read more](https://github.com/necolas/react-native-web#why).

`react-native-web` lets us to write a single app that runs on mobile platform, ie iOS and Android, as well as browser, however, a typical `react-native` project will use libraries such as `react-native-config` that works perfectly on `react-native` but not on `react-native-web`. `react-web-config` allows you to continue using `react-native-config` seamlessly on the web by adding a few lines in your webpack config.

### Usage

Step 1 and 2 is what you have done if you follow the [guides](https://github.com/luggit/react-native-config#usage) from react-native-config.


1) Create a new file `.env` in the root of your React Native app:

```js
// .env

API_URL=https://myapi.com
GOOGLE_MAPS_API_KEY=abcdefgh
```

2) Then access variables defined there from your app:

```js
  // app.js
  import Config from 'react-native-config'
  Config.API_URL  // 'https://myapi.com'
```


However if you want to have Step 2 to work on a `react-native-web` project, you will need to configure the following in your `webpack.config.js`:

```diff
  // webpack.config.js

+ const ReactWebConfig = require('react-web-config/lib/ReactWebConfig').ReactWebConfig;
+ const path = require('path');

+ const envFilePath = path.resolve(__dirname, '.env');

  module.exports = {
    ...
    plugins: [
      ...
+     /* define __REACT_WEB_CONFIG__ */
+     ReactWebConfig(envFilePath)
    ],
    resolve: [
      alias: [
        ...
+       /* set alias from react-native-config to react-web-config */
+       'react-native-config': 'react-web-config',
        'react-native': 'react-native-web'
      ]
    ]
  }
```

### License

MIT
npm package: @hortemo/expo-billing-client
Description: Expo module that wraps Google Play BillingClient APIs
Author: Henrik Hortemo
Latest version: 1.0.1

# @hortemo/expo-billing-client

Thin Android wrapper around the Google Play BillingClient for Expo / React Native apps.

## Installation

```sh
npm install @hortemo/expo-billing-client
```

## Usage

```ts
import BillingClient, {
  BillingResponseCode,
  ProductType,
} from "@hortemo/expo-billing-client";

BillingClient.addListener(
  "purchasesUpdated",
  async ({ billingResult, purchases }) => {
    if (billingResult.responseCode === BillingResponseCode.OK) {
      for (const purchase of purchases) {
        if (!purchase.isAcknowledged) {
          await BillingClient.acknowledgePurchase(purchase);
        }

        // Grant entitlements
      }
    }
  }
);

const connectionResult = await BillingClient.startConnection();
if (connectionResult.responseCode !== BillingResponseCode.OK) {
  throw new Error(connectionResult.debugMessage);
}

const { productDetailsList } = await BillingClient.queryProductDetails({
  products: [
    { productId: "coins_100", productType: ProductType.INAPP },
    { productId: "pro_subscription", productType: ProductType.SUBS },
  ],
});

const subscription = productDetailsList.find(
  (product) => product.productId === "pro_subscription"
);

await BillingClient.launchBillingFlow({
  products: [
    {
      productId: subscription.productId,
      productType: ProductType.SUBS,
      offerToken: subscription.subscriptionOfferDetails[0].offerToken,
    },
  ],
});
```
npm package: @hortemo/expo-content-resolver
Description: Expo module that exposes Android's ContentResolver query API.
Author: Henrik Hortemo
Latest version: 1.0.0

# @hortemo/expo-content-resolver

Exposes Android's `ContentResolver#query` API, letting React Native (Expo) apps query the MediaStore.

## Installation

```sh
npm install @hortemo/expo-content-resolver
```

## Usage

```ts
import ContentResolver, {
  EXTERNAL_CONTENT_URI,
  MediaColumns,
  ImageColumns,
  QUERY_SORT_DIRECTION,
} from '@hortemo/expo-content-resolver';

const recentLandscapePhotos = await ContentResolver.query(
  EXTERNAL_CONTENT_URI.Images,
  [
    MediaColumns._ID,
    MediaColumns.DISPLAY_NAME,
    MediaColumns.DATE_ADDED,
    MediaColumns.SIZE,
    MediaColumns.WIDTH,
    MediaColumns.HEIGHT,
    ImageColumns.MIME_TYPE,
  ],
  {
    QUERY_ARG_SQL_SELECTION: `${MediaColumns.MIME_TYPE} = ? AND ${MediaColumns.WIDTH} > ${MediaColumns.HEIGHT}`,
    QUERY_ARG_SQL_SELECTION_ARGS: ['image/jpeg'],
    QUERY_ARG_SORT_COLUMNS: [MediaColumns.DATE_ADDED],
    QUERY_ARG_SORT_DIRECTION: QUERY_SORT_DIRECTION.DESCENDING,
    QUERY_ARG_LIMIT: 5,
  }
);
```
npm package: @hortemo/expo-media3-transformer
Description: Media3 Transformer
Author: Henrik Hortemo
Latest version: 1.0.1

# @hortemo/expo-media3-transformer

`@hortemo/expo-media3-transformer` exposes the Android [Media3 Transformer](https://developer.android.com/guide/topics/media/media3) API to Expo and React Native apps.

> Transformer is an API for editing media, including converting between formats (transcoding), applying changes like trimming a clip from a longer video, cropping a portion of the video frame, applying custom effects, and other editing operations.

## Installation

```sh
npm install @hortemo/expo-media3-transformer
```

## Example

```ts
import Transformer, {
  MimeType,
  Layout,
  AudioProcessorType,
  VideoEffectType,
} from "@hortemo/expo-media3-transformer";
import * as FileSystem from "expo-file-system";

const result = await Transformer.transform({
  mediaItem: {
    uri: new FileSystem.File(FileSystem.Paths.document, "input.mp4").uri,
    clippingConfiguration: {
      startPositionMs: 5_000,
      endPositionMs: 15_000,
    },
    videoEffects: [
      {
        type: VideoEffectType.PresentationForAspectRatio,
        aspectRatio: 1,
        layout: Layout.SCALE_TO_FIT_WITH_CROP,
      },
      {
        type: VideoEffectType.FrameDropEffect,
        targetFrameRate: 24,
      },
    ],
    audioProcessors: [
      {
        type: AudioProcessorType.ChannelMixingAudioProcessor,
        channelMixingMatrices: [
          {
            inputChannelCount: 2,
            outputChannelCount: 1,
          },
        ],
      },
    ],
  },
  outputPath: new FileSystem.File(FileSystem.Paths.cache, "output.mp4").uri,
  videoMimeType: MimeType.VIDEO_H264,
  audioMimeType: MimeType.AUDIO_AAC,
  encoderFactory: {
    requestedVideoEncoderSettings: {
      bitrate: 4_000_000,
    },
  },
});
```
npm package: @hortemo/expo-photos
Description: Expo module exposing advanced iOS Photos APIs.
Author: Henrik Hortemo
Latest version: 11.0.0

# @hortemo/expo-photos

Lightweight Expo (React Native) wrapper for Apple's [Photos](https://developer.apple.com/documentation/photos) framework.

## Installation

```sh
npm install @hortemo/expo-photos
```

## API Reference

### Functions

- `fetchAssets(options: FetchAssetsOptions): Promise<PHAsset[]>`
- `requestImage(options: RequestImageOptions): Promise<void>`
- `requestVideo(options: RequestVideoOptions): Promise<void>`
- `pickAssets(options: PickAssetsOptions): Promise<PHAsset[]>`
- `authorizationStatus(accessLevel: PHAccessLevel): Promise<PHAuthorizationStatus>`
- `requestAuthorization(accessLevel: PHAccessLevel): Promise<PHAuthorizationStatus>`
- `presentLimitedLibraryPicker(): Promise<void>`

### Components

#### PHImageView

A native image component that displays photos from the Photos library using `PHImageManager`.

```tsx
import {
  PHImageView,
  PHImageContentMode,
  PHImageRequestOptionsResizeMode,
  PHImageRequestOptionsDeliveryMode,
  UIViewContentMode,
} from "@hortemo/expo-photos";

<PHImageView
  localIdentifier={asset.localIdentifier}
  contentMode={UIViewContentMode.scaleAspectFill}
  requestOptions={{
    contentMode: PHImageContentMode.aspectFit,
    resizeMode: PHImageRequestOptionsResizeMode.fast,
    deliveryMode: PHImageRequestOptionsDeliveryMode.highQualityFormat,
    targetSize: { width: 300, height: 300 },
    isNetworkAccessAllowed: true,
  }}
  onLoad={(event) => console.log(event.nativeEvent)}
  onError={(event) => console.log(event.nativeEvent.message)}
  style={{ width: 300, height: 300 }}
/>
```

#### PHVideoView

A video player component that streams videos from the library.

```tsx
import { PHVideoView, PHVideoRequestOptionsDeliveryMode } from "@hortemo/expo-photos";

<PHVideoView
  localIdentifier={asset.localIdentifier}
  requestOptions={{
    isNetworkAccessAllowed: true,
    deliveryMode: PHVideoRequestOptionsDeliveryMode.automatic,
  }}
  onLoad={(event) => console.log(event.nativeEvent)}
  onError={(event) => console.log(event.nativeEvent.message)}
  style={{ width: 300, height: 200 }}
/>
```
npm package: @hortemo/expo-storekit
Description: Expo module for StoreKit 2 purchases, subscriptions, and entitlement sync on iOS/tvOS.
Author: hortemo
Latest version: 1.1.0

# @hortemo/expo-storekit

Lightweight wrapper for StoreKit 2.

## Installation

```sh
npm install @hortemo/expo-storekit
```

## API Reference

- `requestProducts(productIds: string[]): Promise<Product[]>`
- `purchase(productId: string, purchaseOptions?: PurchaseOptions): Promise<ProductPurchaseResult>`
- `finishTransaction(transactionId: string): Promise<void>`
- `requestCurrentEntitlements(): Promise<TransactionVerificationResult[]>`
- `sync(): Promise<void>`
- `addListener(eventName: "transactionUpdated", listener: (result: TransactionVerificationResult) => void): EventSubscription`
npm package: @hortemo/expo-transcoder
Description: Native video transcoding for Expo apps
Author: Henrik Hortemo
Latest version: 1.0.0

# @hortemo/expo-transcoder

React Native (Expo) wrapper for [Otalia Studios Transcoder](https://github.com/natario1/Transcoder).

## Installation

```sh
npm install @hortemo/expo-transcoder
```

## Usage

```ts
import Transcoder, {
  DataSourceType,
  ResizerType,
} from "@hortemo/expo-transcoder";

const successCode = await Transcoder.transcode({
  dataSink: "/path/to/input.mp4",
  dataSources: [
    {
      type: DataSourceType.TrimDataSource,
      trimStartUs: 5_000_000,
      trimEndUs: 10_000_000,
      source: {
        type: DataSourceType.FilePathDataSource,
        path: "/path/to/output.mp4",
      },
    },
  ],
  videoTrackStrategy: {
    resizers: [
      {
        type: ResizerType.AtMostResizer,
        atMostMajor: 1080,
        atMostMinor: 1920,
      },
    ],
    bitRate: 5_000_000,
  },
});
```
npm package: @hortemo/seeded-shuffle
Description: Deterministic, seed-based shuffle for JS/TS.
Author: Henrik Hortemo
Latest version: 1.0.2

# @hortemo/seeded-shuffle

Deterministically shuffle arrays with a repeatable seed.

## Install

```bash
npm i @hortemo/seeded-shuffle
```

## Usage

```ts
import seededShuffle from "@hortemo/seeded-shuffle";

const original = [1, 2, 3, 4, 5];
const shuffled = seededShuffle(original, "my-seed");
```

### API

`seededShuffle<T>(input, seed)` returns a shuffled copy of `input` using a [`seedrandom`](https://www.npmjs.com/package/seedrandom) PRNG.
npm package: @hortemo/semaphore
Description: A minimal FIFO semaphore for JS/TS.
Author: Henrik Hortemo
Latest version: 1.0.1

# @hortemo/semaphore

Promise-based FIFO semaphore for JavaScript and TypeScript.

## Install

```bash
npm install @hortemo/semaphore
```

## Use

```ts
import Semaphore from "@hortemo/semaphore";

const semaphore = new Semaphore(5);

async function processItem(item: string): Promise<void> {
  const release = await semaphore.acquire();
  try {
    await doWork(item);
  } finally {
    release();
  }
}

await Promise.all(items.map(processItem));
```

## API

- `new Semaphore(permits: number)`: Create a semaphore with `permits` available.
- `await semaphore.acquire()`: Wait for a permit and receive a `Releaser`. Call it to free the permit.
- `type Releaser = () => void`
npm package: @horuel/scule-linux-arm-gnueabihf
Description: This is the **armv7-unknown-linux-gnueabihf** binary for `@horuel/scule`
Latest version: 0.1.2

# `@horuel/scule-linux-arm-gnueabihf`

This is the **armv7-unknown-linux-gnueabihf** binary for `@horuel/scule`
npm package: @horuel/scule-linux-x64-musl
Description: This is the **x86_64-unknown-linux-musl** binary for `@horuel/scule`
Latest version: 0.1.2

# `@horuel/scule-linux-x64-musl`

This is the **x86_64-unknown-linux-musl** binary for `@horuel/scule`
npm package: @horuel/scule-win32-arm64-msvc
Description: This is the **aarch64-pc-windows-msvc** binary for `@horuel/scule`
Latest version: 0.1.2

# `@horuel/scule-win32-arm64-msvc`

This is the **aarch64-pc-windows-msvc** binary for `@horuel/scule`
npm package: @horuel/scule-win32-x64-msvc
Description: This is the **x86_64-pc-windows-msvc** binary for `@horuel/scule`
Latest version: 0.1.2

# `@horuel/scule-win32-x64-msvc`

This is the **x86_64-pc-windows-msvc** binary for `@horuel/scule`