# @codecolde/utility-package

> Personal Utility Package

Latest version **0.0.8** (published 2019-10-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install @codecolde/utility-package
pnpm add @codecolde/utility-package
yarn add @codecolde/utility-package
bun add @codecolde/utility-package
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2019-10-13 |
| First published | 2019-09-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | CodeColde |
| Maintainers | codecolde |

## Links

- npm: https://www.npmjs.com/package/@codecolde/utility-package
- Repository: https://github.com/CodeColde/cold-utilities
- Homepage: https://github.com/CodeColde/cold-utilities#readme
- Issues: https://github.com/CodeColde/cold-utilities/issues
- npm.io page: https://npm.io/package/@codecolde/utility-package

## Recent versions

- 0.0.8 (latest) — 2019-10-13
- 0.0.7 — 2019-10-06
- 0.0.6 — 2019-09-25
- 0.0.5 — 2019-09-24
- 0.0.4 — 2019-09-23
- 0.0.3 — 2019-09-23
- 0.0.2 — 2019-09-23
- 0.0.1 — 2019-09-23

## README

# Cold Utilities - The Variety Utility Function Package
CodeColde's Personal Utility Package.

Fork the (test project)[https://codesandbox.io/embed/utility-package-with-typescript-t908w?fontsize=14] if you want to play around!

See below the table of contents with docs regarding what each function does:

## Generics
These utilities aren't limited to a particular case for usability. These can vary, and are simply generally handy utilities.

### Strip HTML Tags
Retrieve a HTML string and strip all tags.

```javascript
    import { stripHTMLTags } from '@codecolde/utility-package';

    const HTMLString = `<p>Hello <i>To All</i> <a href='link'><span>a great</span></a> World</p>`;
    const stripped = stripHTMLTags(HTMLString); // returns 'Hello To All a great World'.
```

### Pipe
Used for left-sided function execution. Expects an initializer, but returns the return value of provided functions.

```javascript
    import { pipe } from '@codecolde/utility-package';
    
    const carInit = owner => ({ // for typescript, the return value must be of the type of return the pipe will produce. This return value is also the case for the piped functions
        owner
    });
    
    const redCar = car => ({
        color: "red",
        ...car
    });

    const bmwBrand = car => ({
        brand: "bmw",
        ...car
    });

    const audiBrand = car => ({
        brand: "audi",
        ...car
    });

    const myCar = pipe(         // returns {
        carInit("CodeColde"),   //  owner: 'CodeColde',
        redCar,                 //  color: 'red',
        bmwBrand                //  brand: 'bmw',
    );                          // }

    const myCar = pipe(         // returns {
        carInit("User"),        //  owner: 'User',
        redCar,                 //  color: 'red',
        audiBrand               //  brand: 'audi',
    );                          // }
```


## Articles
For articles, a user might want some things to touch up their article publishing. Below are some utility functions that you can use:

### Reading Time
Check the duration of an article that a user has wrote. Accepts an array of strings or a string.

```javascript
    import { readingTime } from '@codecolde/utility-package';

    const article = `<article text here>` || `['article', 'content', 'here']`;
    const duration = readingTime(article); // returns a number, rounding down. If an article takes 2.9 minutes to read, it returns 2.
```

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