open-index/open-npm huggingface dataset:
npm package: @mgcloud/create-demo
Description: ```bash npm install -g @mgcloud/create-demo
Author: wudi
Latest version: 0.0.2

# 🚀 @mgcloud/create-demo

## Use

```bash
npm install -g @mgcloud/create-demo

$ mgcloud-create --help

@mgcloud - 生成不同模板项目

Usage: mgcloud-create [OPTION]... [DIRECTORY]

创建一个新的项目, 集成用户中心与获取路由等能力.
如果不带参数启动, 将进入交互模式的 CLI.

Available templates:
demo-ui        demo-ui-vue3

```
npm package: @mgcloud/lib-base
Description: 提供了一些基础功能和工具的封装。
Author: wudi
Latest version: 1.1.0

# 🚀 @mgcloud/lib-base

提供了一些基础功能和工具的封装。

- **request**: 简化的网络请求功能
- **security**: 前端安全 (防止 XSS 攻击)

使用示例

```ts
import { ref } from 'vue'
import { request, xssFilter } from '@mgcloud/lib-base'

interface LoginByCodesTypes {
  code: string
  mobile: string
}

interface LoginByCodesResultTypes {
  token: string
}

export function loginByCodesApi(data: LoginByCodesTypes) {
  return request<LoginByCodesResultTypes>({
    baseURL: '/api',
    url: `/user/loginByCodes`,
    method: 'post',
    data,
  })
}

const xssHtml = ref(
`
<h1 id="title">XSS Demo</h1>

<p class="text-center">
Sanitize untrusted HTML (to prevent XSS) with a configuration specified by a Whitelist.
</p>

<form>
  <input type="text" name="q" value="test">
  <button id="submit">Submit</button>
</form>

<pre>hello</pre>

<p>
  <a href="http://jsxss.com">http</a>
  <a href="https://jsxss.com">https</a>
  <a href="ftp://jsxss.com">ftp</a>
  <a href="other1">other1</a>
  <a href="/other2">other2</a>
  <a href="#">other3</a>
</p>

<h3 style="color: #fff;">Features:</h3>
<ul>
  <li>Specifies HTML tags and their attributes allowed with whitelist</li>
  <li>Handle any tags or attributes using custom function</li>
</ul>

<script type="text/javascript">
alert(/xss/);
<\/script>
`,
)

console.log(xssFilter(xssHtml.value))
```
npm package: @mgcloud/lib-utils
Description: The @mgcloud package internal tooling approach
Author: wudi
Latest version: 0.0.11

# 🚀 @mgcloud/lib-utils

该库为项目提供了便捷的方法工具封装，方便开发人员进行各种操作。

## 功能模块

- **check**: 类型检查相关函数
- **color**: 包含了颜色相关的函数，用于在终端中添加样式和色彩
- **currency**: 提供货币格式化及计算相关功能
- **helpers**: 常用辅助函数集合
  - device-id: 设备 ID 相关操作 (used monitor uin field)
  - platform: 平台判断和处理
  - time-utils: 时间日期处理工具
- **number-precision**: 解决 JavaScript 数字精度问题的相关函数
- **token**: 提供了处理令牌和身份验证相关的功能
- **validate**: 包含了数据验证的工具函数，用于确保数据的合法性和正确性

## 安装

```bash
pnpm install @mgcloud/lib-utils
```

## 使用示例

```typescript
// 检查是否为 HTTP 链接
import { isHttp_RY } from '@mgcloud/lib-utils'
const result = isHttp_RY('https://example.com') // true

// 数字精度计算
import { plus } from '@mgcloud/lib-utils'
const sum = plus(0.1, 0.2) // 0.3

// 货币格式化
import { formatCurrency } from '@mgcloud/lib-utils'
const price = formatCurrency(1234.56) // ¥1,234.56
```
npm package: @mgcloud/pc-base-ui
Description: A Vue.js UI components library for mgcloud business applications.
Author: wudi
Latest version: 0.7.4

# 🚀 @mgcloud/pc-base-ui

[![NPM](https://nodei.co/npm/@mgcloud/pc-base-ui.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/@mgcloud/pc-base-ui/)

[![npm version](https://img.shields.io/npm/v/@mgcloud/pc-base-ui.svg)](https://www.npmjs.com/package/@mgcloud/pc-base-ui)
[![npm downloads](https://img.shields.io/npm/dm/@mgcloud/pc-base-ui.svg)](https://www.npmjs.com/package/@mgcloud/pc-base-ui)

## Installation

```bash
pnpm install @mgcloud/pc-base-ui
```

## Usage Guide

```typescript
// 按需引入组件 (Recommended: Import components as needed)
import { MgButton } from '@mgcloud/pc-base-ui'

// 组件内部样式
import '@mgcloud/pc-base-ui/style.css'
// or
import '@mgcloud/pc-base-ui/dist/style.css'

// TODO: deprecated
// 请注意，在 0.1.6 版本提供给 > vue 2.7 版本使用，之后组件库将对低于  vue 2.7 版本不在维护
// 使用方式样式
import '@mgcloud/pc-base-ui/lib/css/index.css'
```
npm package: @mgcloud/uncrypto
Description: Single API for Web Crypto API and Crypto Subtle working in Node.js, Browsers and other runtimes
Author: wudi
Latest version: 0.0.1

# 🚀 @mgcloud/uncrypto

[![npm version](https://img.shields.io/npm/v/@mgcloud/uncrypto?logo=npm)](https://www.npmjs.com/package/@mgcloud/uncrypto)

This library provides a single api to use [web-crypto](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) and [Subtle Crypto](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto) in both Node.js using [Crypto Module](https://nodejs.org/api/crypto.html#crypto) and Web targets using [Web Crypto API](https://nodejs.org/api/crypto.html#crypto) using [Conditional Exports](https://nodejs.org/api/packages.html#conditional-exports).

**Requirements:**

- **Node.js**: Version **15 and above** (this library provides no polyfills for older versions!)
- **Browser**: [Secure Context](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts) (HTTPS/Localhost) in [Supported Browsers](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto#browser_compatibility)
- **Other Runtimes:** Exposed `globalThis.crypto` and `globalThis.crypto.subtle`. (you can polyfill if neeeded)

## Usage

Install package:

```sh
# pnpm
pnpm install @mgcloud/uncrypto
```

Import:

```js
// ESM
import { subtle, randomUUID, getRandomValues } from '@mgcloud/uncrypto'

// CommonJS
const { subtle, randomUUID, getRandomValues } = require('@mgcloud/uncrypto')
```

## 📜 License

[MIT](../../LICENSE) License &copy; 2023-PRESENT [wudi](https://github.com/WuChenDi)