Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

brazilianholiday

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brazilianholiday

Biblioteca para feriados brasileiros no âmbito nacional e estadual

  • 1.0.9
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
94
increased by308.7%
Maintainers
1
Weekly downloads
 
Created
Source

Brazilian Holiday

Simples biblioteca para verificação de feriado a partir de data recebida.

Instalação

npm install brazilianholiday

Exemplo de Uso

isHoliday(date, uf = null)

Verifica se data é um feriado

//PARAMS

date
- required: true
- type: string
- format: 'DD/MM/YYYY'

uf
- required: false
- type: string
- format: 'DD/MM/YYYY'

const {brazilianHoliday} = require('brazilianholiday');

let date = '01/01/2023';

console.log(brazilianHoliday.isHoliday(date));

/*
{
  holiday: true,
  description: 'Confraternização Universal',
  date: '01/01/2024'
}
*/

date = '20/01/2023';

console.log(brazilianHoliday.isHoliday(date, 'AC'));

/*
{ 
    holiday: true, 
    description: 'Dia do Católico', 
    date: '20/01/2024' 
}
*/

all()

Retorna json completo de feriados.

const {brazilianHoliday} = require('brazilianholiday');

console.log(brazilianHoliday.all());
/*
{
  moveable: [ Array ],
  national: [ Array ],
  state: [ Array ]
}
*/

Histórico de Versões

  • 1.0.9 [ESTÁVEL]
    • FEAT: function all and test
  • 1.0.8 [ESTÁVEL]
    • FEAT: function isHoliday

Como Contribuir

Ajude-nos alimentando o arquivo .json com feriados móveis que variam a cada ano.

"moveable": [
        {
            "year": "2024",
            "holidays": [
                {
                    "date": "12/02",
                    "description": "Carnaval"
                },
                {
                    "date": "13/02",
                    "description": "Carnaval"
                },
                {
                    "date": "29/03",
                    "description": "Paixão de Cristo"
                }
            ]
        }
    ]

Licença:

MIT © Otávio Silva 2023

Linkedin Badge

Keywords

FAQs

Package last updated on 22 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc