Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
chinese-holidays
Advanced tools
提供具有中国特色的休假安排或者工作日查询。
npm install chinese-holidays
支持在线更新数据和本地离线数据两种方式。
var ChineseHolidays = require('chinese-holidays');
ChineseHolidays.ready().then(function(book, err){
if err != null {
return
}
元旦 = new Date(2016, 0, 1)
// 是否休假(含正常的周六、周日)
book.isHoliday(元旦)
// true
// 是否是工作日(含节假日的调休)
book.isWorkingday(元旦)
// fase
// 列出已知的节假日
book.all().forEach(function(holiday){
console.log(holiday.name)
console.log(holiday.days().map(function(date) { return moment(date).format('YYYY-MM-DD') }))
})
// 元旦
// ["2016-01-01", "2016-01-02", "2016-01-03"]
// ...
// 列出所有的特殊日子(节假日和调休)
book.events().forEach(function(event){
console.log(event.name, event.days(), event.isHoliday(), event.isWorkingday())
})
})
// disable update from remote, default is false.
const options = {
offline: true
};
ChineseHolidays.ready(options)
支持在线更新节假日数据,如果无法联网则使用本地打包的数据。
The package is available as open source under the terms of the MIT License.
FAQs
Chinese holidays
We found that chinese-holidays demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.