open-index/open-npm huggingface dataset:
npm package: @lancercomet/lib.semaphore
Description: This is a semaphore implementation.
Author: LancerComet
Latest version: 1.0.1

# @lancercomet/lib.semaphore

This is a simple semaphore implementation.

## Quick start

```ts
import { Semaphore } from '@lancercomet/lib.semaphore'

// A semaphore with available and max count in 3.
const semaphore = new Semaphore(3, 3)

// Download 3 images at same time.
const downloadImage = async (imageUrl: string) => {
  await semaphore.waitAsync()
  // Do some download work...
  semaphore.release()
}

const imageList: string[] = []
imageList.forEach(imageUrl => downloadImage(imageUrl))
```
npm package: @lancercomet/qiniu-uploader
Description: This package is used for uploading your assets to the Qiniu cloud.
Author: LancerComet
Latest version: 0.1.2

# Qiniu Uploader

This tool is used for uploading assets to the Qiniu CDN.

## Quick start

```
npm install @lancercomet/qiniu-uploader --save-dev
```

```
npx qiniu-uploader --upload-folder dist \
  --qiniu-base-path some-folder-on-qiniu/sub-directory \
  --qiniu-access-key *** \
  --qiniu-secret-key *** \
  --qiniu-bucket some-bucket
```

`qiniu-access-key`, `qiniu-secret-key`, `qiniu-bucket` can be replaced with the system environments `QINIU_ACCESS_KEY`, `QINIU_SECRET_KEY`, `QINIU_BUCKET`.
npm package: @lancercomet/suntori.generator
Description: A codegen to create SunTori codes from JSON.
Author: LancerComet
Latest version: 1.2.0

# SunTori codegen

[![SunTori](https://github.com/LancerComet/SunTori/workflows/Test/badge.svg)](https://github.com/LancerComet/SunTori/actions)
[![npm version](https://badge.fury.io/js/@lancercomet%2Fsuntori.generator.svg)](https://badge.fury.io/js/@lancercomet%2Fsuntori.generator)

A codegen to create [SunTori](https://github.com/LancerComet/SunTori/tree/master/packages/suntori) codes from JSON.

```ts
import { generate } from '@lancercomet/suntori.generator'

const result = await generate({
  jsonObject: {
    name: 'John Smith',
    age: 200,
    address: [
      {
        name: 'Home',
        locaiton: 'The earth'
      }
    ]
  },
  rootClassName: 'User'
})
```

Result:

```ts
@Serializable()
class UserAddress {
  @JsonProperty('name')
  name: string = ''

  @JsonProperty('location')
  location: string = ''
}

@Serializable()
class User {
  @JsonProperty('name')
  name: string = ''

  @JsonProperty('age')
  age: number = 0

  @JsonProperty({
    name: 'address',
    type: UserAddress
  })
  address: UserAddress[] = []
}
```

## Options

 - `jsonObject: never` The JSON payload. Should be a JavaScript Object.
 - `rootClassName: string = 'Root'` The name for generated class. And it will be used as prefix for all subclasses.
 - `useCamelCase: boolean = true` Use `camelCase` during code generation.
 - `addReadonly: boolean = true` Add `readonly` modifier to all members of a class.

## About null

All `null` JSON fields would be converted to the `unknown`, as well as empty arrays.

```ts
await generate({
  jsonObject: {
    a: null,
    b: []
  }
})

// To

@Serializable()
class Root {
  @JsonProperty('a')
  a: unknown = null

  @JsonProperty('b')
  b: unknown[] = []
}
```

## License

Apache-2.0
npm package: @lancercomet/types
Description: A package that contains some type definitions.
Author: LancerComet
Latest version: 1.5.0

# @lancercomet/types

[![MyWebLibs](https://github.com/LancerComet/MyWebLibs/workflows/Test/badge.svg)](https://github.com/LancerComet/MyWebLibs/actions)
[![npm version](https://badge.fury.io/js/@lancercomet%2Ftypes.svg)](https://badge.fury.io/js/@lancercomet%2Ftypes)

A package that contains some type definitions.

## License

Apache-2.0
npm package: @lancercomet/utils
Description: My personal utils lib.
Author: LancerComet
Latest version: 1.1.0

# @lancercomet/utils

[![MyWebLibs](https://github.com/LancerComet/MyWebLibs/workflows/Test/badge.svg)](https://github.com/LancerComet/MyWebLibs/actions)
[![npm version](https://badge.fury.io/js/@lancercomet%2Futils.svg)](https://badge.fury.io/js/@lancercomet%2Futils)

My personal utils lib.

Module included:

 - Blob
 - Cookie
 - Element
 - Format
 - Images
 - Numbers
 - Random
 - Scroll
 - Strings
 - Tasks
 - Time
 - Types
 - Url

## Quick Start

```ts
import { isNumber } from '@lancercomet/utils/typs'
import { getStringCharCount } from '@lancercomet/utils/strings'

isNumber(10)  // true
getStringCharCount('🍺🐸')  // 2
```

## License

Apache-2.0
npm package: @lancercomet/vite-plugin-vue2-hmr
Description: A Vite plugin enables Vue 2 Composition API component hot reloading.
Author: LancerComet
Latest version: 0.1.1

# vite-plugin-vue2-hmr

[![npm version](https://badge.fury.io/js/@lancercomet%2Fvite-plugin-vue2-hmr.svg)](https://badge.fury.io/js/@lancercomet%2Fvite-plugin-vue2-hmr)

A Vite plugin enables Vue 2 Composition API component hot reloading.

This plugin is designed for:

 - J/TSX users who use [vue2-jsx-runtime](https://github.com/LancerComet/vue2-jsx-runtime) + Composition API and want to have Vue 2 hot-relaod enabled.
 - Whom uses Composition API without vite-plugin-vue2 (yes it is possible).

> For people who don't use Vue 2 Composition API or vue2-jsx-runtime, you might want to use [vite-plugin-vue2](https://github.com/underfin/vite-plugin-vue2) instead.

## Features

 - Enables hot-reload for components that are created by using `defineComponent`.
 - Supports not only default exports but also named exports.

## Quick start

```
npm install @lancercomet/vite-plugin-vue2-hmr --save-dev
```

```js
import { vue2HMR } from '@lancercomet/vite-plugin-vue2-hmr'

export default {
  plugins: [
    vue2HMR()
  ]  
}
```

## Options

 - `test?: RegExp` - The file type to match. By default it will only deal with .jsx and .tsx files.

## License

Apache-2.0
npm package: @lancercomet/vue-i18n
Description: Yet another i18n lib for Vue.
Author: LancerComet
Latest version: 0.2.1

# @lancercomet/vue-i18n

Yet another i18n library for Vue 3.

## Features

 - Use it anywhere. Even outside Vue components.
 - Customized mechanism, optimized for JSX Element / Function.
 - Minimal scope function `useT`.