# littletools

> 小工具包

Latest version **0.2.2** (published 2018-05-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install littletools
pnpm add littletools
yarn add littletools
bun add littletools
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2018-05-02 |
| First published | 2018-04-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | sultra |
| Maintainers | sultra |
| Keywords | tool |

## Links

- npm: https://www.npmjs.com/package/littletools
- npm.io page: https://npm.io/package/littletools

## Dependencies (2)

- [yamljs](https://npm.io/package/yamljs.md) ^0.2.8
- [@types/express](https://npm.io/package/@types/express.md) ^4.11.1

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.2.2 (latest) — 2018-05-02
- 0.2.1-alpha — 2018-04-09
- 0.2.0 — 2018-04-02

## README

# Little Tools

## 说明
实用小工具包

``` javaScript
const tools = require('littleTools').tools;
tools.matchString(string,reference); //模糊匹配字符串
tools.loadYaml(file); //加载yaml文件为对象
tools.randomString(length); //生成指定长度到随机字符串，数字+小写字母组合
tools.readConfig(option); //读取配置文件
tools.mergeObject(target,...sources); //合并对象
```

express 中间件
``` javaScript
const mw=require('littleTools').expressMidware;
/*
处理request header中accept属性相应的数据格式，默认application/json，
如果有使用全局错误处理中间件，请放在错误处理之前
*/
app.use(mw.responseAccordingAccept);

/**
 * 处理request header中accept属性相应的数据格式，默认application/json，当返回错误时使用
 */
app.use(mw.responseErrorAccordingAccept);
```

---
_Source: https://npm.io/package/littletools · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
