# us-util

> us util

Latest version **1.3.2** (published 2023-12-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install us-util
pnpm add us-util
yarn add us-util
bun add us-util
```

## 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.3.2 |
| Published | 2023-12-05 |
| First published | 2017-07-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | pan.feng@uprightlaw.biz |
| Maintainers | fengpan23 |
| Keywords | us, util, card type |

## Links

- npm: https://www.npmjs.com/package/us-util
- Repository: https://github.com/fengpan23/us-util
- Homepage: https://github.com/fengpan23/us-util#readme
- Issues: https://github.com/fengpan23/us-util/issues
- npm.io page: https://npm.io/package/us-util

## Alternatives

- [adhdev](https://npm.io/package/adhdev.md) — 11.1K weekly downloads
- [react-slide-button](https://npm.io/package/react-slide-button.md) — 310 weekly downloads
- [better](https://npm.io/package/better.md) — 42 weekly downloads
- [react-native-swipe-image](https://npm.io/package/react-native-swipe-image.md) — 22 weekly downloads
- [nl.fokkezb.pulltorefresh](https://npm.io/package/nl.fokkezb.pulltorefresh.md) — 11 weekly downloads

## Recent versions

- 1.3.2 (latest) — 2023-12-05
- 1.3.1 — 2018-05-11
- 1.3.0 — 2018-05-09
- 1.2.11 — 2018-03-08
- 1.2.10 — 2018-02-02
- 1.2.9 — 2017-12-19
- 1.2.8 — 2017-12-13
- 1.2.7 — 2017-12-04
- 1.2.6 — 2017-11-10
- 1.2.5 — 2017-09-14
- 1.2.4 — 2017-09-04
- 1.2.3 — 2017-09-04
- 1.2.2 — 2017-09-04
- 1.2.1 — 2017-09-04
- 1.2.0 — 2017-08-31
- … 17 more at https://npm.io/package/us-util/versions

## README

# us-util
us util

# intall
npm install us-util --save

# function

## formatPhoneNumber

* format phone number (length = 10)
* eg: 
*   1212121212  =>  (121) 212-1212
* @param  {Number} input  need format number   
* @return {String} 

## splitNumber

* split number    1223300 => 1,223,300
* @param  {Number, String} input
* @return {String}

## StateMap (const)

* US State Map => {Al: Alabama, Ak: Alaska, ...}
* @return {Object}

## capitalizeFirstLetter

* capitalize first letter, lower case others
* eg: firstName => Firstname
* eg: first name => First Name
* @param  {String} string need capitalize string
* @return {String}  

## getStateRemind 
* find us state where match input
* eg:
* MI =>  [ 'Michigan', 'Federated States Of Micronesia', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Wyomin' ]
* @param  {String} input 
* @return {Array}       []

## getLongState 
* get long state
* eg:
* MI =>  'Michigan'
* @param  {string} short state
* @return {string} long state

## getShortState 
* get short state
* eg:
* 'Michigan' => 'MI'
* @param  {string} short state
* @return {string} long state

## isUsState

* is United States  state
* @param  {String}  input  verify string
* @param  {String}  type  only verify type
* @return {Boolean}       is state

## isNumber

* number check
* @param  {String | Number}  input
* @return {Boolean} 

## isUsZipCode

* is us zip code
* @param  {String | Number}  input
* @return {Boolean}

## generateId

* Generates a RFC-4122 version 4 compliant globally unique identifier.
* @return {String}

## isEmail
* is email
* @param  {String}  input
* @return {Boolean}

## clearNumber
* clear number
* @param  {string}
* @return {string}       only number
* eg: '1234 1212 sdf' => 12341212

## getUsCardType
* get us card type
* @param  {String} input 
* @return {String}      	on of card type

## isUsCard
* is us card check
* @param  {String}  input 
* @return {Boolean}

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