open-index/open-npm huggingface dataset:
npm package: @sadais/uploader
Description: ```bash # 安装依赖 npx yarn # 监听实时构建`/dist` npm run dev # 只构建`/dist`一次，不作监听 npm run build ```
Author: sadais
Latest version: 0.5.16

## 开始

```bash
# 安装依赖
npx yarn
# 监听实时构建`/dist`
npm run dev
# 只构建`/dist`一次，不作监听
npm run build
```

### 发布包到私服

```bash
# 登录npm服务器
npm login --registry https://registry.npmjs.org
# 发布
npm publish
```

## 发布之前测试

在当前工程，没有创建组件的单元测试，只能通过把构建后的东西复制到某个项目的 node_modules

比如当前 package.json 的包名是 "@sadais/uploader" , 发布前要在 A 项目中测试 "@sadais/uploader", 在 A 项目的 node_modules 新建 @sadais/uploader , 再把 /dist/ 和 package.json 拷贝到 A 项目的 node_modules/@sadais/uploader

使用

```js

import { UploaderInstance,UPLOADER_TYPE } from '@sadais/uploader';
const uploader = new UploaderInstance(
  {type:UPLOADER_TYPE.ALIYUN,getOptionFun:async (type) => {
      // 获取option示例
      const { head, data } = await apiGetUploadOption(type)
      if (head.ret !== this.$consts.RET_CODE.SUCCESS) return null
      return data
  }}
)

// 获取上传options示例
export const apiGetUploadOption = async type => {
  const params = {
    storageenum: type
  }
  const { data } = await request.get('/api/manage/v1/storage/getstoragesignature', params)
  return data
}

// 调用说明
//单文件上传
const {data,head:{msg,ret}} = await uploader.uploadFile(file)
// 0-成功 1-失败
if(ret===this.$consts.RET_CODE.SUCCESS){
  const url = data
}
//多文件上传
const {successUrls,failUrls} = await uploader.uploadFiles(files)
// successUrls-上传成功的url数组
// failUrls-上传失败的fileName数组

//通用上传，支持单文件和多文件
const [{index,url,ret}] = await uploader.upload(file|files)
// 返回数组
// index：上传文件的下标；
// ret：状态，0-成功，1-失败；
// url：上传成功的路径 或 上传失败的文件名
```

## 发布完成后

在 A 项目安装

```bash
# use yarn
npx yarn add @sadais/uploader -S

# use npm or pnpm
npx pnpm install @sadais/uploader -S
```
npm package: @sadan4/virtual-merge
Description: A utility library to merge multiple Objects virtually
Author: Vendicated
Latest version: 1.0.2

# Virtual Merge

A utility library to merge multiple Objects virtually

```sh
npm install virtual-merge
yarn add virtual-merge
pnpm add virtual-merge
```

Imagine having multiple Objects and wanting to merge those. The usual way to accomplish this is to do
```js
const merged = { ...obj1, ...obj2, ...obj3 };
```
However, changes made on `merged` will not reflect back to the original Objects.
This might be desired, in which case sweet, you don't need this module!

However, if you do want those changes to reflect back to the original object, you can use this module!

## Example

```js
import virtualMerge from "virtual-merge";
// or commonjs
const virtualMerge = require("virtual-merge");

const obj1 = { im: "so cool" };
const obj2 = { hamburgers: "are delicious!" };

const merged = virtualMerge(obj1, obj2);

merged.im = "so cute!";
console.log(merged.im); // "so cute!"
console.log(obj1.im); // "so cute!"

obj1.im = "awesome!";
console.log(merged.im); // "awesome!"

// new properties work too!
merged.someNewProperty = "wow this is in neither of the objects O_O";
console.log(merged.someNewProperty); // "wow this is in neither of the objects O_O"
console.log(obj1.someNewProperty); // undefined
console.log(obj2.someNewProperty); // undefined

// and of course, the usual object methods still work fine!
console.log(Object.keys(merged)); // ["someNewProperty", "im", "hamburgers"]
console.log("im" in merged); // true
console.log(Object.hasOwn(merged, "hamburgers")); // true
```

## License

MIT - Copyright (c) 2023 Vendicated
npm package: @sadanandgadwal/html-to-plain-text
Description: Convert HTML to plain text with React and Next.js support
Author: Sadanand Gadwal
Latest version: 1.0.0

# HTML to Plain Text Converter

[![npm version](https://img.shields.io/npm/v/html-to-plain-text.svg)](https://www.npmjs.com/package/html-to-plain-text)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)

A lightweight, universal HTML to plain text converter that works in React, Next.js, Node.js, and browser environments.

## 🌟 Features

- **Universal compatibility** (Browser & Node.js)
- **React & Next.js optimized** (Hooks & Components)
- **Customizable conversion** (Preserve links, line breaks, etc.)
- **Lightweight** (<5kb gzipped)
- **TypeScript support** (Included type definitions)
- **Open Source** (MIT Licensed)

## 📦 Installation

```bash
npm install html-to-plain-text
# or
yarn add html-to-plain-text
# or
pnpm add html-to-plain-text
```
npm package: @sadbox/async-debounce
Description: Async debounce function
Author: Kirill Mesnyankin
Latest version: 1.1.0

[![Version](https://badgen.net/npm/v/@sadbox/async-debounce)](https://www.npmjs.com/package/@sadbox/async-debounce) [![License](https://badgen.net/npm/license/@sadbox/async-debounce)](https://www.npmjs.com/package/@sadbox/async-debounce) [![Dependencies](https://badgen.net/david/dep/strayiker/async-debounce)](https://www.npmjs.com/package/@sadbox/async-debounce)

# Async Debounce

Debounce async functions.

## Install

`yarn add @sadbox/async-debounce`

or

`npm install -S @sadbox/async-debounce`

## Usage

```javascript
import debounce from '@sadbox/async-debounce';
import asyncPrint from './asyncPrint';
import sleep from './sleep';

const fn = b =>
  new Promise((resolve, reject) =>
    setTimeout(() => (b ? resolve(b) : reject(b)), 50)
  );

// We set 50ms timeout for the debouncing function and 50ms for the 'fn' function
// As a result, we should wait 100ms for the result
const debounced = debounce(fn, 50);

asyncPrint(debounced(false));
sleep(100);
// after 100ms promise will be rejected and 'reject: false' will be printed

asyncPrint(debounced(true));
sleep(75);
asyncPrint(debounced(true));
// after 75ms first promise will be canceled and last result will be repeated
// so 'reject: false' will be printed again

// after 100ms second promise will be resolved with 'resolve: true'
```

## API

```javascript
debounce(fn: Function, timeout: Number, [defaultValue: Any]): Function;
```

`defaultValue` - The value to be returned when a promise is canceled before the original function is resolved/rejected.
npm package: @sadbox/color
Description: Color parser
Author: Kirill Mesnyankin
Latest version: 1.0.0

[![Version](https://badgen.net/npm/v/@sadbox/color)](https://www.npmjs.com/package/@sadbox/color)
[![License](https://badgen.net/npm/license/@sadbox/color)](https://www.npmjs.com/package/@sadbox/color)
[![Dependencies](https://badgen.net/david/dep/strayiker/color)](https://www.npmjs.com/package/@sadbox/color)
[![Bundle Size](https://badgen.net/bundlephobia/minzip/@sadbox/color)](https://www.npmjs.com/package/@sadbox/color)
[![Build Status](https://travis-ci.com/strayiker/color.svg?branch=master)](https://travis-ci.com/strayiker/color)
[![Codecov](https://codecov.io/gh/strayiker/color/branch/master/graph/badge.svg)](https://codecov.io/gh/strayiker/color)

# Color

A lightweight browser compatible color parser.

## Installation

`npm install @sadbox/color`

`yarn add @sadbox/color`

## Supported formats

- `#xxx`
- `#xxxx`
- `#xxxxxx`
- `#xxxxxxxx`
- `rgb()`
- `rgba()`
- `hsl()`
- `hsla()`

## How to use

```javascript
import { Color } from '@sadbox/color';

const color = new Color('#ffff');

color.rgb; // [255, 255, 255]
color.hsl; // [0, 0, 100]
color.alpha; // 1

color.rgb = [0, 0, 0];
color.hsl; // [0, 0, 0]

console.log(color); // #000000
```
npm package: @sadbox/color-utils
Description: A set of utility functions for working with colors
Author: Kirill Mesnyankin
Latest version: 0.2.0

[![Version](https://badgen.net/npm/v/@sadbox/color-utils)](https://www.npmjs.com/package/@sadbox/color-utils) [![License](https://badgen.net/npm/license/@sadbox/color-utils)](https://www.npmjs.com/package/@sadbox/color-utils) [![Dependencies](https://badgen.net/david/dep/strayiker/color-utils)](https://www.npmjs.com/package/@sadbox/color-utils) [![Bundle Size](https://badgen.net/bundlephobia/minzip/@sadbox/color-utils)](https://www.npmjs.com/package/@sadbox/color-utils) [![Build Status](https://travis-ci.com/strayiker/color-utils.svg?branch=master)](https://travis-ci.com/strayiker/color-utils)

# Color Utils

A lightweight set of utility functions for working with colors.
Supported color formats: `#000`, `#0000`, `#000000`, `#00000000`, `rgb()`, `rgba()`, `hsl`, `hsla()`

## Install

`yarn add @sadbox/color-utils`

or

`npm install -S @sadbox/color-utils`

## Usage

```javascript
import { darken } from '@sadbox/color-utils';

const dark = darken('#fff', 0.5); // #808080
```

## Available Utils

- `darken(color, coefficient)`
- `lighten(color, coefficient)`
- `getLuminance(color)`
- `setAlpha(color, alpha)`
npm package: @sadbox/env-snapshot
Description: A tool for creating a copy of env variables.
Author: Kirill Mesnyankin
Latest version: 0.3.1

[![Version](https://badgen.net/npm/v/@sadbox/env-snapshot)](https://www.npmjs.com/package/@sadbox/env-snapshot)
[![License](https://badgen.net/npm/license/@sadbox/env-snapshot)](https://www.npmjs.com/package/@sadbox/env-snapshot)
[![Dependencies](https://badgen.net/david/dep/strayiker/env-snapshot)](https://www.npmjs.com/package/@sadbox/env-snapshot)
[![Build Status](https://travis-ci.org/strayiker/env-snapshot.svg?branch=master)](https://travis-ci.org/strayiker/env-snapshot)

# Env Snapshot

A tool for creating a statically accessible copy of `process.env` variables.

## Installation

`npm install @sadbox/env-snapshot`

`yarn add @sadbox/env-snapshot`

## Usage

```javascript
import { takeEnvSnapshot } from '@sadbox/env-snapshot';

const env = takeEnvSnapshot();

env.NODE_ENV; // production
env.nodeEnv; // production
```

It uses `dotenv` lib under the hood, so next is valid.

```yaml
#.env
CUSTOM_OPTION=value
```

```javascript
const env = takeEnvSnapshot();

env.CUSTOM_OPTION; // value
env.customOption; // value
```
npm package: @sadbox/material-colors
Description: Set of material colors
Author: Kirill Mesnyankin
Latest version: 1.1.0

# CJS Material Colors

## Installation

`npm install @sadbox/material-colors`

`yarn add @sadbox/material-colors`

## How to use

```javascript
import { blue } from '@sadbox/material-colors';

console.log(blue[500]); // #2196f3
```
npm package: @sadbox/node-http-errors
Description: HTTP errors
Author: Kirill Mesnyankin
Latest version: 1.2.0

[![Version](https://badgen.net/npm/v/@sadbox/node-http-errors)](https://www.npmjs.com/package/@sadbox/node-http-errors) [![License](https://badgen.net/npm/license/@sadbox/node-http-errors)](https://www.npmjs.com/package/@sadbox/node-http-errors) [![Dependencies](https://badgen.net/david/dep/strayiker/node-http-errors)](https://www.npmjs.com/package/@sadbox/node-http-errors)

# NodeJs HTTP Errors

Easy to use, class-based http errors. Supports all http statuses.

## Install

`yarn add @sadbox/node-http-errors`

or

`npm install -S @sadbox/node-http-errors`

## Usage

```javascript
import { HttpError, BadRequest } from '@sadbox/node-http-errors';

let err = new HttpError({ code: 500, message: 'Internal Server Error.' });
err = new BadRequest(); // code 400 and default message for bad request error
err = new BadRequest('Bad User Input.'); // with custom message
err = new BadRequest({ fieldErrors }); // with custom property
```
npm package: @sadbox/service-locator
Description: An implementation of Service Locator pattern
Author: Kirill Mesnyankin
Latest version: 1.0.2

[![Version](https://badgen.net/npm/v/@sadbox/service-locator)](https://www.npmjs.com/package/@sadbox/service-locator) [![License](https://badgen.net/npm/license/@sadbox/service-locator)](https://www.npmjs.com/package/@sadbox/service-locator) [![Dependencies](https://badgen.net/david/dep/strayiker/service-locator)](https://www.npmjs.com/package/@sadbox/service-locator)

# Service Locator

An implementation of Service Locator pattern.

## Install

`yarn add @sadbox/service-locator`

or

`npm install -S @sadbox/service-locator`

## Usage

```javascript
import ServiceLocator from '@sadbox/service-locator';
import Service1 from './Service1';
import Service2 from './Service2';

const services = new ServiceLocator();

services.register({
  name: 'Service1',
  constructor: Service1,
  args: ['option'],
});

services.register({
  name: 'Service2',
  constructor: Service2,
  deps: ['Service1'],
  singleton: false,
});

const {
  Service1: service1, // instance of Service1
  Service2: service2, // instance of Service2
} = services;
```

## API

```javascript
ServiceLocator.register({
  name,
  constructor,
  instance,
  args,
  deps,
  singleton,
});
```

Registers service and allow to take it instance later.

`name (string)` - Unique name of the service.

`constructor ({ new (): any })` - The service "newable" class.

`instance (any)` - Instance of the service. Whenever you will ask to instance, it will be returned.

`args (Array<any>)` - Arguments to pass to the constructor when creating an instance.

`deps (Array<string>)` - List of service names to resolve and pass to the constructor when creating an instance.

`singleton (boolean)` - If `true`, only first resolve will create instanse of the service. Subsequent resolves will return the same instance. If `false` new instanse will be created on each resolve. Default is `false`.

---

```javascript
ServiceLocator.resolve(name);
```

or

```javascript
ServiceLocator[name];
```

Returns an instance of the service.

`name (string)` - Name of the service.

---

```javascript
ServiceLocator.evict(name: string)
```

Removes the instance of the service and all instances of the services that depends on it.

`name (string)` - Name of the service.
npm package: @sadbox/walledator
Description: Asynchronous data validation
Author: Kirill Mesnyankin
Latest version: 0.3.1

[![Version](https://badgen.net/npm/v/@sadbox/walledator)](https://www.npmjs.com/package/@sadbox/walledator)
[![License](https://badgen.net/npm/license/@sadbox/walledator)](https://www.npmjs.com/package/@sadbox/walledator)
[![Dependencies](https://badgen.net/david/dep/strayiker/walledator)](https://www.npmjs.com/package/@sadbox/walledator)
[![Bundle Size](https://badgen.net/badgesize/gzip/https://unpkg.com/@sadbox/walledator/dist/walledator.cjs.js)](https://www.npmjs.com/package/@sadbox/walledator)
[![Build Status](https://travis-ci.org/strayiker/walledator.svg?branch=master)](https://travis-ci.org/strayiker/walledator)
[![Codecov](https://codecov.io/gh/strayiker/walledator/branch/master/graph/badge.svg)](https://codecov.io/gh/strayiker/walledator)

# Walledator

An environment agnostic nano-robot to perform schema validations.

## Install

`yarn add @sadbox/walledator`

or

`npm install -S @sadbox/walledator`

## Usage

```javascript
import Q from '@sadbox/walledator';

const isFree = email => request('/email-is-free', email);

const schema = Q.shape({
  email: Q.email.custom({ key: 'taken', isFree }).required,
  password: Q.string.match(regex).size({ min: 8 }).required,
});

// server
schema.validate(request.body);

// client
schema.defineMessages({
  'shape.email.email': 'is not an email',
  'shape.email.taken': 'is already taken',
  'shape.password.match': 'contains invalid symbols',
  'shape.password.size': 'does not match the size limitations',
  'shape.required': 'is required',
});
schema.validate(form.values, { humanize: true });
```
npm package: @sadcitizen/eslint-config
Description: default eslint configuration
Author: Eugene Abrosimov
Latest version: 1.0.0

# @sadcitizen/eslint-config

[![Build Status](https://travis-ci.org/sadcitizen/eslint-config.svg?branch=master)](https://travis-ci.org/sadcitizen/eslint-config)

> Configuration for Eslint

## Install

```
$ npm install @sadcitizen/eslint-config
```

## Usage

### Basic

`.eslintrc`:

```json
{
  "extends": "@sadcitizen/eslint-config"
}
```

### React, React Hooks and Jest

`.eslintrc`:

```json
{
  "extends": [
      "@sadcitizen/eslint-config",
      "@sadcitizen/eslint-config/react",
      "@sadcitizen/eslint-config/react-hooks",
      "@sadcitizen/eslint-config/jest"
  ]
}
```
npm package: @sadcitizen/postcss-config
Description: default postcss configuration
Author: Eugene Abrosimov
Latest version: 0.2.0

# @sadcitizen/postcss-config

[![Build Status](https://travis-ci.org/sadcitizen/postcss-config.svg?branch=master)](https://travis-ci.org/sadcitizen/postcss-config)

> Configuration for PostCSS

## Install

```
$ npm install @sadcitizen/postcss-config
```

## Usage

`postcss.config.js`:

```js
module.exports = require('@sadcitizen/postcss-config');
```
npm package: @sadcitizen/stylelint-config
Description: default stylelint configuration
Author: Eugene Abrosimov
Latest version: 0.2.0

# @sadcitizen/stylelint-config

[![Build Status](https://travis-ci.org/sadcitizen/stylelint-config.svg?branch=master)](https://travis-ci.org/sadcitizen/stylelint-config)

> Configuration for Stylelint

## Install

```
$ npm install @sadcitizen/stylelint-config
```

## Usage

`.stylelintrc`:

```json
{
  "extends": "@sadcitizen/stylelint-config"
}
```
npm package: @sadephp/sade
Description: Bridge package between Sade and Node
Author: Fredrik Forsmo
Latest version: 1.0.0-alpha

# Sade

[![Build Status](https://travis-ci.org/sadephp/sade.svg?branch=master)](https://travis-ci.org/sadephp/sade)

> Work in progress!

Sade, a library for creating PHP Components with [Twig](https://twig.symfony.com/doc/2.x/) (2.x). This package will not do any preprocessing or somthing like that.

## Documentation

The documentation is located [here](https://sadephp.github.io)

## Example

```php
<template>
    <p>{{ greeting }} World!</p>
</template>

<style scoped>
    p {
        font-size: 2em;
        text-align: center;
    }
</style>

<?php
    return [
        'data' => function() {
            return [
                'greeting' => 'Hello'
            ];
        }
    ];
?>
```

To render

```php
$sade = new \Sade\Sade(__DIR__ . '/examples');

echo $sade->render('greeting.php');
```

## License

MIT © [Fredrik Forsmo](https://github.com/frozzare)