flaformatter
TypeScript icon, indicating that this package has built-in type declarations

2.0.3 • Public • Published

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

  • cpf: 123.123.123-12

  • cnpj: 12.123.123/1234-12

  • cpf/cnpj: 123.123.123-12 or 12.123.123/1234-12

  • telefone: 1234 1234

  • int: 123456789

  • celular: (12) 12345-1234

  • cep: 12345-123

  • money: 123.123.123,12

  • card: 1234 1234 1234 1234


Feature maxLength :


You can set thrid param as true to use flaformatter default maxLength.

example:

<input onChange={(e)=>flaFormatter(e,'cep',true)} />

Readme

Keywords

Package Sidebar

Install

npm i flaformatter

Weekly Downloads

1

Version

2.0.3

License

ISC

Unpacked Size

3.73 kB

Total Files

4

Last publish

Collaborators

  • flaviano-rodrigues