0.2.0 • Published 4 years ago

portuguese-utils v0.2.0

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

Portuguese Javascript Utils

Build Status Maintainability Test Coverage

A set of useful utils for developing Portuguese Web Applications.

How to install

Using CDN

You can use this lib in the browser using the minified bundle via CDN.

<script src="https://cdn.jsdelivr.net/npm/portuguese-utils@latest/portuguese-utils.min.js" />
<script>
    portugueseUtils.isValidPostalCode('3863-122')
</script>

Using NPM

npm install --save portuguese-utils

Import the needed function

From the validators module

import { isValidPostalCode } from 'portuguese-utils/validators'

From the single exported function

import isValidPostalCode from 'portuguese-utils/validators/isValidPostalCode'

From the full package

import { isValidPostalCode } from 'portuguese-utils'

An the use the function as shown bellow

const postalCode = '3863-122'
const isMyPostalCodeValid = isValidPostalCode(postalCode)
console.log(isMyPostalCodeValid) // true

Available Utils

Formaters

As the name says these utils allow to format input data

  • formatDate
  • formatDateExtended
  • formatDateTime
  • formatDecimalNumber
  • formatToCurrency

Validators

These utils allows you to validate input data

  • isValidCCNumber
  • isValidCPECUI
  • isValidCurrency
  • isValidHoliday
  • isValidLicensePlate
  • isValidMobileNumber
  • isValidNIF
  • isValidNISS
  • isValidNNU
  • isValidPostalCode

Helpers

These utils offer other helpers useful in portuguese apps

  • holidays
  • monthsExtended
  • monthsSlug
  • weekDays
  • weekDaysSlug

Documentation

Documentation of all utils is available at: https://portuguese-utils.netlify.com/

License

MIT

0.2.0

4 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago