Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Lightweight and dependency-free module to get Colombian holidays.
Getting Colombian holidays is a little bit tricky because there are three types of holidays:
To install as a dependency of your project:
npm install pascua
To load it on the browser you can use unpkg
, just add the following script. The pascua
object will be available globally.
Pascua include two functions: getHoliday
y getAllHolidays
.
The getHoliday
function allows to check if a given date is a holiday. It takes as an optional argument a JavaScript date and returns the name of the holiday in case the date is a holiday, or an empty string (""
)if it isn't.
const { getHoliday } = require('pascua')
const date = new Date('13-04-2017')
const holiday = getHoliday(date)
console.log(holiday)
// 'Jueves Santo'
If the date is ommited, by defaul the function is going to use the current date.
The function getAllHolidays(year)
allows to get all the holidays for a given year, returning an array with the holidays for the requested year:
const { getAllHolidays } = require('pascua')
const holidays2010 = getAllHolidays(2010)
The content of the holidays2010
variable will be the following array:
[
{ date: '2010-01-01', type: 1, name: 'Año Nuevo' },
{ date: '2010-05-01', type: 1, name: 'Día del Trabajo' },
{ date: '2010-07-20', type: 1, name: 'Grito de la Independencia' },
{ date: '2010-08-07', type: 1, name: 'Batalla de Boyacá' },
{ date: '2010-12-08', type: 1, name: 'Inmaculada Concepción' },
{ date: '2010-12-25', type: 1, name: 'Navidad' },
{ date: '2010-01-11', type: 2, name: 'Reyes Magos' },
{ date: '2010-03-22', type: 2, name: 'San José' },
{ date: '2010-07-05', type: 2, name: 'San Pedro y San Pablo' },
{ date: '2010-08-16', type: 2, name: 'Asunción de la Virgen' },
{ date: '2010-10-18', type: 2, name: 'Día de la Raza' },
{ date: '2010-11-01', type: 2, name: 'Todos los Santos' },
{ date: '2010-11-15', type: 2, name: 'Independencia de Cartagena' },
{ date: '2010-04-01', type: 3, name: 'Jueves Santo' },
{ date: '2010-04-02', type: 3, name: 'Viernes Santo' },
{ date: '2010-05-17', type: 3, name: 'Ascensión de Jesús' },
{ date: '2010-06-07', type: 3, name: 'Corpus Christi' },
{ date: '2010-06-14', type: 3, name: 'Sagrado Corazón de Jesús' },
],
Is the year is ommited, by default the function will return the holidays for the current year.
Contributions, issues and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
FAQs
Calculate Easter date for a given year
The npm package pascua receives a total of 263 weekly downloads. As such, pascua popularity was classified as not popular.
We found that pascua demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.