
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
一个显示出生年月日的小组件,不依赖带三方组件
npm install show-age
// 或者 yarn
yarn add show-age
let age = require('show-age')
console.log(age('1993-6-26',{
now: new Date('2020-2-10')
}))
// 26岁
//
大于IntegerAge配置项,按照整岁来显示年龄,例如:6岁
小于或者等于IntegerAge配置项,大于一天的,按照年月日来显示,例如:1岁9月20天
小于一天的按照小时来展示,少于一小时默认一小时显示,例如:3小时
let options = {
defaultVal:'--', //时间传递错返回值
IntegerAge:5, // 根据此配置项来展示月份及其日
now:new Date(), // 参照时间
i18n :{ // 国际化相关部分
year: '岁',
month:'月',
days: '天',
hour:'小时'
}
}
FAQs
We found that show-age 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
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.