2.2.0 • Published 7 months ago
flaformatter v2.2.0
Getting Started :D
A simple example. I promise to write a better readme
Install:
npm i flaformatter
Import:
import flaFormatter from 'flaformatter'
Use:
<input maxlength={9} onChange={(a)=>flaFormatter(a,'cep')} />
The maxLength is optional. It is used to limit the number of characters
Response:
99999-999
Available formats :
rg
: 12.123.123-1cpf
: 123.123.123-12cnpj
: 12.123.123/1234-12cpf/cnpj
: 123.123.123-12 or 12.123.123/1234-12telefone
: 1234 1234int
: 123456789celular
: (12) 12345-1234cep
: 12345-123money
: 123.123.123,12card
: 1234 1234 1234 1234percent
: 12,34%time
: 12:34
Feature maxLength :
You can set thrid param as true
to use flaformatter default maxLength.
example:
<input onChange={(e)=>flaFormatter(e,'cep',true)} />