# returnyes-js-utils

> handwrite js-utils

Latest version **1.0.0** (published 2022-10-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install returnyes-js-utils
pnpm add returnyes-js-utils
yarn add returnyes-js-utils
bun add returnyes-js-utils
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-10-03 |
| First published | 2022-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 41.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | returnyes |
| Maintainers | returnyes |
| Keywords | js |

## Links

- npm: https://www.npmjs.com/package/returnyes-js-utils
- npm.io page: https://npm.io/package/returnyes-js-utils

## Dependencies (4)

- [cors](https://npm.io/package/cors.md) ^2.8.5
- [express](https://npm.io/package/express.md) ^4.18.1
- [webpack](https://npm.io/package/webpack.md) ^5.74.0
- [webpack-cli](https://npm.io/package/webpack-cli.md) ^4.10.0

## 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.0 (latest) — 2022-10-03

## README

# js-utils

## prepare

```bash
npm run build
```

## nodeJS

```bash
npm run start
```

## webpack config

## 1. function

- call(fn, obj, ...args)

- apply(fn, obj, args)

- bind(fn, obj, ...args)

- throttle(callback, wait)

- debounce(callback, delay)

## 2. array

- map(arr, callback)

- reduce(arr, callback, initValue)

- filter(arr, callback)

- find(arr, callback)

- findIndex(arr, callback)

- every(arr, callback)

- some(arr, callback)

- unique1(arr)/unique2(arr)/unique3(arr)

- concat(arr, ...args)

- slice(arr, [begin[, end)])

- flatten1(arr)/flatten2(arr)

- chunk1(arr, size)/chunk2(arr, size)

- difference(arr1, arr2)

- pull(arr, ...args)

- pullAll(arr, values)

- drop(arr, size)

- dropRight(arr, size)

- compact(arr)

## 3. object

- newInstance(Fn, ...args)

- myInstanceof(obj, Type)

- mergeObject(...args)

- clone1(target)/clone2(target)

- deepClone1(target)/deepClone2(target)/deepClone3(target, map = new Map())/deepClone4(target, map = new Map())

## 4. string

- reverseString(str)

- isPalindrome(str)

- truncate(str, len)

## 5. extends

## 6. event-bind

- addEventListener(el, type, fn, selector)

## 7. event-bus

- eventBus.on(event, fn)

- eventBus.emit(event, data)

- eventBus.off(event)

## 8. pub-sub

- pubSub.subscribe(channel, fn)

- pubSub.publish(channel, data)

- pubSub.publishSync(channel, data)

- pubSub.unsubscribe(flag)

## 9. ajax

- axios({url, method, params, data})

- get(url, options)

- post(url, data, options)

- put(url, data, options)

- delete(url, options)

- nodeJS

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