open-index/open-npm huggingface dataset:
npm package: @helpusersvote/copy
Description: JavaScript functions to render election-related CTAs
Author: UserMirror
Latest version: 1.0.2

# @helpusersvote/copy

JavaScript functions to render election-related CTAs

## Installation

First, add the module to your codebase:

```bash
npm install --save @helpusersvote/copy
```

## Usage

In your app, import functions and text from the `@helpusersvote/copy` module:

```javascript
import { getElectionText, electionCopy } from '@helpusersvote/copy'

// Pass in optional configuration to `getElectionText()`

const {
  // Election day is in 3 days!
  titleText,
  // Get ready to vote
  ctaText,
  // https://vote.org
  ctaHref
} = getElectionText({ type: 'countdown' })

// Or get the static text directly with `electionCopy`

const {
  text: {
    registration: {
      // Get ready to vote in 2018!
      title: titleText,
      // Check if you're registered today
      cta: ctaText
    }
  }
} = electionCopy
```

## License

All modules are open-sourced under the [MIT License](https://github.com/helpusersvote/modules/blob/master/license)
npm package: @helpusersvote/election-copy
Description: JavaScript functions to render election-related CTAs
Author: Fouad Matin
Latest version: 0.0.1

# @helpusersvote/election-copy

JavaScript functions to render election-related CTAs

## Installation

First, add the module to your codebase:

```bash
npm install --save @helpusersvote/election-copy
```

## Usage

In your app, import functions and text from the `@helpusersvote/election-copy` module:

```javascript
import { getElectionText, electionCopy } from '@helpusersvote/election-copy'

// Pass in optional configuration to `getElectionText()`

const {
  // Election day is in 3 days!
  titleText,
  // Get ready to vote
  ctaText,
  // https://vote.org
  ctaHref
} = getElectionText({ type: 'countdown', daysLeft: 3 })

// Or get the static text directly with `electionCopy`

const {
  text: {
    registration: {
      // Get ready to vote in 2018!
      title: titleText,
      // Check if you're registered today
      cta: ctaText
    }
  }
} = electionCopy
```

## License

All modules are open-sourced under the [MIT License](https://github.com/helpusersvote/modules/blob/master/license)
npm package: @helpusersvote/election-logic
Description: Simple APIs to help your users vote
Author: Help Users Vote
Latest version: 0.2.2

# @helpusersvote/election-logic

JavaScript functions to check if a call-to-action should be rendered

## Installation

First, add the module to your codebase:

```bash
npm install --save @helpusersvote/election-logic
```

## Usage

In your app, import functions from the `@helpusersvote/election-logic` module:

```javascript
import { shouldShowCTA } from '@helpusersvote/election-logic'

// Optional `regions` configuration, defaults to USA
const regions = [
  'city:San Francisco',
  'state:California',
  'country:USA'
]

// wherever you want to render the call-to-action
if (shouldShowCTA({ regions })) {
  // render a custom banner or use `@helpuservote/election-copy`
}
```

## License

All modules are open-sourced under the [MIT License](https://github.com/helpusersvote/modules/blob/master/license)
npm package: @helpusersvote/logic
Description: Simple JavaScript APIs to help your users vote
Author: UserMirror
Latest version: 1.0.14

# @helpusersvote/logic

JavaScript functions to check if a call-to-action should be rendered

## Installation

First, add the module to your codebase:

```bash
npm install --save @helpusersvote/logic
```

## Usage

In your app, import functions from the `@helpusersvote/logic` module:

```javascript
import { shouldShowCTA } from '@helpusersvote/logic'

// Optional `regions` configuration, defaults to USA
const regions = [
  'city:San Francisco',
  'state:California',
  'country:USA'
]

// wherever you want to render the call-to-action
if (shouldShowCTA({ regions })) {
  // render a custom banner or use `@helpuservote/copy`
}
```

## License

All modules are open-sourced under the [MIT License](https://github.com/helpusersvote/modules/blob/master/license)
npm package: @helpusersvote/react
Description: React components to help your users vote
Author: UserMirror, Inc.
Latest version: 1.2.4

# @helpusersvote/react

React components to help your users vote

## Installation

First, add these components to your codebase:

```bash
npm install --save @helpusersvote/react
```

## Usage

In your app, import components from the `@helpusersvote/react` module to add them to a page:

```javascript
import { Banner } from '@helpusersvote/react'
import Home from '../components/home'

const HomePage = props => (
  <Home>
    <Banner ctaColor="red" />
  </Home>
)

export default HomePage
```

If you want to add tracking to your call-to-action, add your namespace and campaign:

```javascript
import { Banner } from '@helpusersvote/react'
import Home from '../components/home'

const HomePage = props => (
  <Home>
    <Banner namespace="example.com" campaign="home-page" />
  </Home>
)

// Which is the same as doing
const HomePage = props => (
  <Home>
    <Banner ctaHref="https://go.helpusersvote.com/v1/example.com/home-page" />
  </Home>
)

export default HomePage
```

If you want to only show the banner on special days, use the `ShouldShowCTA` component:

```javascript
import { ShouldShowCTA, Banner } from '@helpusersvote/react'
import Home from '../components/home'

// namespaceId = partner id for your team
// id = lookup key for call-to-action, e.g. where it's rendered
const HomePage = props => (
  <Home>
    <ShouldShowCTA>
      <Banner namespace="example.com" campaign="home-page">
    </ShouldShowCTA>
  </Home>
)

export default HomePage
```

## License

All modules are open-sourced under the [MIT License](https://github.com/helpusersvote/modules/blob/master/license)
npm package: @helsevestikt/hviktor-angular
Description: Angular-komponenter basert på Digdir Designsystemet for Helse Vest IKT
Author: Helse Vest IKT
Latest version: 0.1.2

# @helsevestikt/hviktor-angular

[![npm version](https://img.shields.io/npm/v/@helsevestikt/hviktor-angular)](https://www.npmjs.com/package/@helsevestikt/hviktor-angular)
[![license](https://img.shields.io/npm/l/@helsevestikt/hviktor-angular)](https://github.com/HelseVestIKT/hviktor/blob/main/projects/hviktor/LICENSE)

> ⚠️ **Denne pakken er under aktiv utvikling.** API-et kan endres uten forvarsel. Bruk på egen risiko i produksjon.

Angular-komponenter basert på [Digdir Designsystemet](https://designsystemet.no/) for Helse Vest IKT.

## Installasjon

### Automatisk oppsett (anbefalt)

```bash
ng add @helsevestikt/hviktor-angular
```

Dette installerer pakken og setter opp prosjektet automatisk:

- Legger til `@import '@helsevestikt/hviktor-angular/styles.css'` i stylesheet
- Spør om du vil installere og konfigurere **Tailwind CSS**. (default: Yes). Anbefales for best mulig utvikleropplevelse. Alle demoene på [helsevestikt.github.io/hviktor](https://helsevestikt.github.io/hviktor/) bruker Tailwind, så det kan være lurt å ha det installert for å følge eksemplene.
- Spør om du vil installere **@helsevestikt/hviktor-icons** (default: Yes). Installerer ikonpakken og legger til global import i `main.ts`.

### Manuelt oppsett

```bash
npm install @helsevestikt/hviktor-angular
```

Importer stylesheet i `src/styles.css`:

```css
@import '@helsevestikt/hviktor-angular/styles.css';
```

## Bruk

Importer komponentene du trenger direkte i standalone-komponenter:

```typescript
import { HviButton } from '@helsevestikt/hviktor-angular';

@Component({
  imports: [HviButton],
  template: `<button hviButton>Klikk meg</button>`,
})
export class MyComponent {}
```

## Dokumentasjon

Se [helsevestikt.github.io/hviktor](https://helsevestikt.github.io/hviktor/) for tilgjengelige komponenter, eksempler og API-dokumentasjon.

## Krav

- Angular 17–21
- Node.js 20+

## Endringslogg

Se [CHANGELOG.md](https://github.com/HelseVestIKT/hviktor/blob/main/projects/hviktor/CHANGELOG.md) for alle versjonsendringer.

## Bidra

Se [CONTRIBUTING.md](https://github.com/HelseVestIKT/hviktor/blob/main/CONTRIBUTING.md) for utviklingsprosess og retningslinjer.

## Lisens

[MIT](./LICENSE)
npm package: @helsing45/copydeck-cli
Description: Copydeck-CLI is a command line interface that allow you to transform Android, IOS or i18Next ressources files into a more user friendly Csv files. The translation from any type of file to any other type of file. ## Install To install this command line int
Latest version: 1.0.0

# Copydeck-CLI
Copydeck-CLI is a command line interface that allow you to transform Android, IOS or i18Next ressources files into a more user friendly Csv files. The translation from any type of file to any other type of file.
## Install
To install this command line interfaces you will need to run those two command

First of course 
```
npm i copydeck-cli
```
then 
```
npm link @helsing45/copydeck-cli
```

# Commands
## Init
To create your configuration file you will need to run the command
```
copydeck --init [path]
```
or 
```
copydeck -i [path]
```

Where the path is where your config file will be save.

When creating your config file you will need to answers a few question.
### 1) Reading file type 
Determine what type of file you will translate from. You can choose between those 5 types; _'Android'_,_'Csv'_, _'IOS'_, _'i18Next'_, _'universal'_
### 2) Reading file path
The path where the reading file are.
### 3) Filter by
The eval string use to filter what item you want to keep. If you translate from a Csv file you can filter by column name. Let's say in my Csv file there's a column name Target where you can have the string for Android, IOS, Mobile (use by both Android and IOS) and some for the WebConsole. Now i'm building my config file to translate Csv to Android i can filter with:
```
Target == "Android" || Target == "Mobile" 
```

if in my Csv file contain mutliple project you can always add a column Project and filter like this:
```
(Target == "Android" || Target == "Mobile") && (Project == "P1" || Project == "All")
```
### 4) Writing file type 
Determine what type of file you will translate to. You can choose between those 5 types; _'Android'_,_'Csv'_, _'IOS'_, _'i18Next'_, _'universal'_

### 5) Writing file path  
The path where the file will be written.
### 6) Is there a default language 
In the case you translating a Csv to Android you want to indicate what language will be name values 
### 6.1) What is the default language 
Indicate what the default language is.

## Translate
To create your configuration file you will need to run the command
```
copydeck --translate_path [path]
```
or 
```
copydeck -t [path]
```

Where the path is where your config file is saved

If you are at the location of your config file, and the file is named _config.json_ you can also run.

```
copydeck translate
```
npm package: @helstern/react-context-composer
Description: compose a DAG of components using React Context in a declarative fashion
Author: radu helstern
Latest version: 0.1.0

# `@helstern/react-context-composer`

> compose a DAG of components using React Context in a declarative fashion

## Usage

```
const reactContextComposer = require('@helstern/react-context-composer');

// TODO: DEMONSTRATE API
```
npm package: @helt/remove-url-scheme
Description: Removes scheme from URL, i.e. Http://. Case insensitive
Author: vhking
Latest version: 2.4.0

# remove-url-scheme

[![npm (scoped)](https://img.shields.io/npm/v/@helt/remove-url-scheme.svg)](https://www.npmjs.com/package/@helt/remove-url-scheme)
[![GitHub issues](https://img.shields.io/github/issues/vhking/remove-url-scheme)](https://github.com/vhking/remove-url-scheme/issues)
[![GitHub stars](https://img.shields.io/github/stars/vhking/remove-url-scheme)](https://github.com/vhking/remove-url-scheme/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/vhking/remove-url-scheme)](https://github.com/vhking/remove-url-scheme/network)
[![GitHub license](https://img.shields.io/github/license/vhking/remove-url-scheme)](https://github.com/vhking/remove-url-scheme/blob/master/LICENSE)

Removes scheme from URL, e.g. 'Http://'. Case insensitive

Author of regex expression: [FailedDev](https://stackoverflow.com/a/8206299)

![RegexExpVis](../../img/regexExpVis.png)

## Install

```powershell
$ npm install @helt/remove-url-scheme
```

## Usage

1) Register the `RemoveUrlSchemeModule` in your app module.
 > `import { RemoveUrlSchemeModule } from '@helt/remove-url-scheme';`

```typescript
import { HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RemoveUrlSchemeModule } from '@helt/remove-url-scheme';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    ...
    HttpClientModule,
    RemoveUrlSchemeModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule {}
 
```

2) Used through pipe operator in template or DI in component
```html
<button mat-stroked-button>
    <i class="material-icons">language</i>
    {{'https://github.com' | removeUrlScheme}}
</button>

```

```typescript
import { RemoveUrlSchemePipe } from '@helt/remove-url-scheme';

export class ExampleComponent implements OnInit {
  newUrl!: string;
  constructor(private removeUrlSchemePipe: RemoveUrlSchemePipe) {
    this.newUrl = this.rus.tranform('https://github.com');
  }
  ngOnInit() {
  }
}

```
> https://github.com -> github.com 

</br>

> http://github.com -> github.com
npm package: @helux/f-guard
Description: Make concurrent function running highly efficient.
Author: fantasticsoul
Latest version: 0.1.3
Deprecated: false

# f-guard

函数并发保护助手，目前包含：creaate-flat-promise, concurrency-guard

## 示例

### concurrency-guard

并发保护类，标识了相同 key 的多个函数在高并发场景同时执行时，只有一个函数会真正执行，其他的则进入等待并复用此函数结果

普通使用

```ts
import { ConcurrencyGuard } from '@helux/f-guard';

const guard = new ConcurrencyGuard();
const aHeavyAsyncTask = async () => {
  /** ... */ return 1;
};

await guard.call('key', aHeavyAsyncTask);

// 并发时，对于相同key的调用，只有一个函数会被触发，其他的会等待结果
await Promise.all([guard.call('key', aHeavyAsyncTask), guard.call('key', aHeavyAsyncTask), guard.call('key', aHeavyAsyncTask)]);
```

透传参数给目标函数

```ts
const aHeavyAsyncTask = async (p1, p2) => {
  /** ... */ return 1;
};

await guard.call('key', aHeavyAsyncTask, 1, 2);
// or
await guard.apply('key', aHeavyAsyncTask, [1, 2]);
```

在类里使用

```ts
class Cat {
  private guard = new ConcurrencyGuard();

  public async shout(someKey, p1, p2) {
    return this.guard.call(someKey, async () => {
      /** code here with p1 p2 */
      console.log(p1, p2);
      return 'Calling shout will take 3 seconds';
    });
  }
}
```

在类里使用，封装成员函数

```ts
class Cat {
  private guard = new ConcurrencyGuard();

  private async shoutLogic(p1, p2) {
    /** code here */
    return 'Calling shout will take 3 seconds';
  }

  private async shoutLogicWrap(p1, p2) {
    return this.shoutLogic(p1, p2);
  }

  public async shout(someKey, p1, p2) {
    return this.guard.call(someKey, this.shoutLogic, p1, p2);
  }

  /** 特别注意：如调用的成员函数非箭头函数，主要主动调用 bind(this)，否则函数 this 会丢失 */
  public async shoutWrap(someKey, p1, p2) {
    return this.guard.call(someKey, this.shoutLogicWrap.bind(this), p1, p2);
  }
}
```

### flat-promise

创建一个可脱离回调修改状态的扁平化 Promise，替代`new Promise()`，简化接收异步结果的写法，在处理复杂的控制流语句场景时更方便、更灵活。

> 注：`ConcurrencyGuard` 内部逻辑也是基于 `createFlatPromise` 封装的

```ts
import { createFlatPromise } from '@helux/f-guard';

// 基于 createFlatPromise 打开 indexedDB（简易版）
async function getIndexedDBIns(databaseName, version) {
  const promise = createFlatPromise();
  const request = window.indexedDB.open(databaseName, version);
  request.onerror = (event) => promise.reject(event);
  request.onsuccess = (event) => promise.resolve(request.result);
  return promise;
}

// 基于 new Promise 打开 indexedDB（简易版）
async function getIndexedDBIns(databaseName, version) {
  const promise = new Promise((resolve, reject) => {
    const request = window.indexedDB.open(databaseName, version);
    request.onerror = (event) => reject(event);
    request.onsuccess = (event) => resolve(request.result);
  });
  return promise;
}
```
npm package: @helux/f-noop
Description: Function does nothing, this lib supply noop fn or noop fn maker.
Author: fantasticsoul
Latest version: 0.0.3
Deprecated: false

# @helux/f-noop

空函数合集，一共导出了以下空函数或空函数创建函数，可按需使用

```ts
export {
  makeNoopAny,
  makeNoopAnyAsync,
  noopAny,
  noopAnyAsync,
  noopNum,
  noopNumAsync,
  noopObj,
  noopObjAsync,
  noopStr,
  noopStrAsync,
  noopVoid,
  noopVoidAsync,
};
```

## 使用方式

同步的 any 空函数

```ts
import { noopAny } from '@helux/f-noop';

const fn = noopAny;
fn();
```

异步的 any 空函数

```ts
import { noopAnyAsync } from '@helux/f-noop';

const fn = noopAnyAsync;
fn().then(console.log);
```

创建自定义返回结果的异步空函数

```ts
import { makeNoopAnyAsync } from '@helux/f-noop';

const fn = makeNoopAnyAsync(333);
fn().then(console.log); // print 333
```
npm package: @helux/hooks-impl
Description: helux hooks implement lib
Author: fantasticsoul
Latest version: 5.5.10
Deprecated: false

# helux-hooks-impl

## useObject

使用普通对象，需注意此接口只接受普通对象，应用里使用 useObject 替代 React.useState 将享受到以下两个好处

- 方便定义多个状态值时，少写很多 useState
- 内部做了 unmount 判断，让异步函数也可以安全的调用 setState，避免 react 出现警告 : "Called SetState() on an Unmounted Component" Errors

```ts
const [obj, setObj] = useObject({ num: 1, age: 2 });
setObj({ num: 2 }); // 只需要传修改的值即可，内部会自动合并
```

## useMutable

深层次的修改需要使用 `useMutable` 替代 `useObject`

```ts
const [state, setState] = useMutable({ info: { age: 1 } });
setState((draft) => (draft.info.age = 2));
```

## useEffect

对齐 React.useEffect，但优化了调用逻辑，即 strict 模式与普通模式行为一致，只有一次 mount 与 unmount 产生

```ts
import { useEffect } from 'helux';

function Comp() {
  useEffect(() => {
    log('helux.useEffect', 'print one time at strict mode');
    return () => log('helux.useEffect', 'cleanup');
  }, []);
  React.useEffect(() => {
    logRed('React.useEffect', 'print 2 times at strict mode');
    return () => logRed('React.useEffect', 'cleanup');
  }, []);
  return <MarkUpdate>test useEffect</MarkUpdate>;
}
```

## useStable

生成稳定的对象，对象的所有方法将转为稳定引用，且回调里始终可以读到外部的最新值，无闭包陷阱

```ts
function Comp(props: any) {
  const [obj, setObj] = useObject({ num: 1 });
  // srv 是稳定的，srv.readState，srv.readProps，srv.changeState 是稳定的
  const srv = useStable({
    readState() {
      console.log(`%c read state num ${obj.num}`, `color:green`);
    },
    readProps() {
      console.log(`%c read props num ${props.num}`, `color:green`);
    },
    changeState() {
      setObj({ num: random() });
    },
  });

  // 传入值，则只是返回最新值
  const numTwo = useStable(2);

  // 如传入单函数，则返回的稳定的函数引用
  const fn = useStable(() => {
    console.log(`%c read state num ${obj.num}`, `color:green`);
  });
}
```
npm package: @helux/openinula
Description: State library for preact that integrates atom, signal, collection dep, derive and watch.
Author: fantasticsoul
Latest version: 5.5.10
Deprecated: false

# helux-openinula

对接 helux-core 供 `openinula` 使用的状态库

## desc

[helux](https://heluxjs.github.io/helux),集原子，信号、依赖追踪为一体，支持细粒度响应式更新的状态引擎（兼容所有类 react 库，包括 react18）

### install

```bash
npm i @helux/openinula
```

### online demo

https://codesandbox.io/p/devbox/helux-openinula-66gfj2
npm package: @helux/plugin-devtool
Description: devtool for helux
Author: fantasticsoul
Latest version: 5.0.0
Deprecated: false

# helux-plugin-devtool

use this plugin at your entry file

```ts
import { addPlugin } from 'helux';
import { HeluxPluginDevtool } from '@helux/plugin-devtool';

addPlugin(HeluxPluginDevtool);
```

## Attention

You must set `moduleName` when create a shared state to let the devtool record state changing.

```ts
atom(1, { moduleName: 'num' });
```
npm package: @helux/preact
Description: State library for preact that integrates atom, signal, collection dep, derive and watch.
Author: fantasticsoul
Latest version: 3.5.24
Deprecated: false

# helux

对接 helux-core 供 `preact` 使用的状态库，目前无法导出 `preact/compact` 使用，用户可参考此[示例 helux-preact-starter](https://codesandbox.io/s/helux-preact-starter-dnyzpy)自己做适配

> 适配代码在 `src/libs/helux` 里
npm package: @helveg/nestjs-octokit
Description: Octokit module for NestJS - forked from overnested/nestjs-octokit
Author: Robin De Schepper
Latest version: 1.0.1

# NestJS Octokit Module

This module facilitates the usage of [Octokit](https://github.com/octokit/octokit.js) in [NestJS](https://github.com/nestjs/nest).

## Introduction

Octokit is "The all-batteries-included GitHub SDK for Browsers, Node.js, and Deno".
Using `nestjs-octokit` you can register the Octokit module and configure it the way NestJS suggests, then inject it as a standard NestJS injectable.

## Installation

On Yarn:

```shell
yarn add nestjs-octokit octokit
```

On NPM:

```shell
npm install nestjs-octokit octokit
```

## Usage

First register the module:

```ts
import { OctokitModule } from 'nestjs-octokit';

@Module({
  imports: [
    OctokitModule.forRoot({
      isGlobal: true,
      octokitOptions: {
        auth: 'my-github-token',
      },
    }),
    // ...
  ],
})
export class AppModule {}
```

Or if want to inject any dependency:

```ts
import { OctokitModule } from 'nestjs-octokit';

@Module({
  imports: [
    OctokitModule.forRootAsync({
      isGlobal: true,
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: async (configService: ConfigService) => ({
        octokitOptions: {
          auth: configService.get<string>('GITHUB_AUTH_TOKEN'),
        },
      }),
    }),
    // ...
  ],
})
export class AppModule {}
```

Then you can inject the service:

```ts
import { OctokitService } from 'octokit-nestjs';

@Controller()
export class SomeController {
  constructor(private readonly octokitService: OctokitService) {}

  @Get('/')
  someEndpoint() {
    const response = await this.octokitService.rest.search.repos({
      q: 'nest-js',
    });

    return response.data.items;
  }
}
```

## Plugins

To use plugins:

```ts
import { OctokitModule } from 'octokit-nestjs';
import { throttling } from '@octokit/plugin-throttling';

@Module({
  imports: [
    OctokitModule.forRoot({
      isGlobal: true,
      plugins: [throttling], // Pass them here
      octokitOptions: {
        // Plugin options:
        throttle: {
          onRateLimit: (retryAfter, options, octokit) => {
            octokit.log.warn(
              `Request quota exhausted for request ${options.method} ${options.url}`
            );
          },
          onAbuseLimit: (retryAfter, options, octokit) => {
            octokit.log.warn(
              `Abuse detected for request ${options.method} ${options.url}`
            );
          },
        },
      },
    }),
  ],
})
export class AppModule {}
```