# ock-helpers

> A collection of helpers to boost the development speed and code share

Latest version **1.0.4** (published 2020-03-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install ock-helpers
pnpm add ock-helpers
yarn add ock-helpers
bun add ock-helpers
```

## 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.4 |
| Published | 2020-03-07 |
| First published | 2020-03-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Joao Mantovani |
| Maintainers | joaomantovani |
| Keywords | helpers, functions |

## Links

- npm: https://www.npmjs.com/package/ock-helpers
- Repository: https://github.com/ockpaydev/ock-helpers
- Homepage: https://github.com/ockpaydev/ock-helpers#readme
- Issues: https://github.com/ockpaydev/ock-helpers/issues
- npm.io page: https://npm.io/package/ock-helpers

## 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

- 1.0.4 (latest) — 2020-03-07
- 1.0.3 — 2020-03-07
- 1.0.0 — 2020-03-07

## README

# Ock Helpers

A collection of helpers to boost the development speed and code share

## Installation

Use npm or yarn

```bash
yarn add bla
```

```bash
npm install bla
```

## Usage

```python
import foobar

foobar.pluralize('word') # returns 'words'
foobar.pluralize('goose') # returns 'geese'
foobar.singularize('phenomena') # returns 'phenomenon'
```

## Features

### Currency

To parse/format money using the pt-br/BRL currency

#### addCurrency

Add a R$ BRL currency if necessary

- Adds R$ prefix

```js
const withPrefix = addCurrency('20.0')
// return will be: R$ 20.0
```

#### parseCurrencyToABNT

Format a number (float) to a BRL currency according to ABNT

- Convert dots to commas
- Adds R$ prefix
- Adds 0 at end if necessary

```js
const abntFormat = parseCurrencyToABNT('20.0')
// return will be: R$ 20,00
```

#### parseCurrencyToFloat

Converts a string on BRL currency format to float

- Convert commas to dots
- Removes R$ prefix
- Removes the 0 at end if exists

```js
const floatCurrency = parseCurrencyToFloat('R$ 20,00')
// return will be: 20.0
```

## License
[MIT](https://choosealicense.com/licenses/mit/)

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