# @greenstreet/formatters

> A Library of data-type to string formatters

Latest version **1.0.1** (published 2020-09-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install @greenstreet/formatters
pnpm add @greenstreet/formatters
yarn add @greenstreet/formatters
bun add @greenstreet/formatters
```

## 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.1 |
| Published | 2020-09-25 |
| First published | 2020-09-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 19.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | James Pritchett |
| Maintainers | jameswpritchett |
| Keywords | greenstreet, formatters |

## Links

- npm: https://www.npmjs.com/package/@greenstreet/formatters
- Repository: https://github.com/GreenStreetSolutions/formatters
- Homepage: https://github.com/GreenStreetSolutions/formatters#readme
- Issues: https://github.com/GreenStreetSolutions/formatters/issues
- npm.io page: https://npm.io/package/@greenstreet/formatters

## Dependencies (1)

- [moment](https://npm.io/package/moment.md) ^2.29.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2020-09-25
- 1.0.0 — 2020-09-25

## README

# Formatters

A Library of data-type to string formatters

## Build

Run `npm run build` to build the project. The build artifacts will be stored in the `dist/` directory. 

## Running unit tests

Run `npm run test` to execute the unit tests via [Jest](https://jestjs.io/).

## Formatters

formatBoolean takes an any and returns true or false.  if the input value can't be easily coerced, it returns false

formatDate takes a Date Object and optionally a format string and culture string.  [moment.js](https://momentjs.com/docs/#/displaying/format/) is used internally for formatting. Presets are

formatDateTime takes a Date Object and optionally a format string and culture string.  [moment.js](https://momentjs.com/docs/#/displaying/format/) is used internally for formatting.

formatDateAsISO takes a Date object and returns the date in ISO. e.g. 2020-09-25.  An optional flag set to true will also return the time part. e.g. 2020-09-25T12:30:00

formatNumber takes a number and optionally a number of decimal places and culture string.  Defaults to 0 decimal places.

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