# @58fe/utils

> JS-Utils

Latest version **1.0.10** (published 2020-03-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install @58fe/utils
pnpm add @58fe/utils
yarn add @58fe/utils
bun add @58fe/utils
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2020-03-20 |
| First published | 2019-12-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 15.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | shangpanpan |
| Maintainers | artoriaschan, felix_xue, imlimiao, jackchou, marinamumu, rainbow_zh, reking, shangpanpan, xiaoyuya, zhangboyu, zhangyongming |
| Keywords | 58, JS, javascript, util |

## Links

- npm: https://www.npmjs.com/package/@58fe/utils
- Repository: git@igit.58corp.com:zp-component/utils
- npm.io page: https://npm.io/package/@58fe/utils

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.10 (latest) — 2020-03-20
- 1.0.9 — 2020-03-20
- 1.0.8 — 2020-03-17
- 1.0.7 — 2019-12-20
- 1.0.6 — 2019-12-20
- 1.0.5 — 2019-12-20
- 1.0.4 — 2019-12-18
- 1.0.3 — 2019-12-12
- 1.0.2 — 2019-12-12
- 1.0.1 — 2019-12-12
- 1.0.0 — 2019-12-12

## README

# Utils

> JS哆啦A梦工具包

## Install

```sh
npm install @58fe/utils  --save
```

## Usage

### cookie
```javascript
import { cookie } from '@58fe/utils';

cookie.getCookie(name);
cookie.setCookie(name, value, outdays, path, domain);
```

### getOS
```javascript
import { getOs } from '@58fe/utils';

console.log(getOs()); // android/wp/ios
```

### urlQuery
```javascript
import { urlQuery } from '@58fe/utils';

// for example url: https://www.baidu.com/?a=1&b=2
console.log(urlQuery.query('a'));
// 1
console.log(urlQuery.queryAll());
// {a: 1, b: 2}
```

### calcaulate
```javascript
import { calcaulate } from '@58fe/utils';
calcaulate(); // must do
const num = 7;
console.log(num.add(1));
// 8
console.log(num.sub(2));
// 5
console.log(num.mul(2));
// 14
console.log(num.div(2));
// 3.5
console.log(num.toFixedNew(2));
// 7
console.log(7.3456.toFixedNew(2));
// 7.35
```

## 其他

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