Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@dh-react-hooks/use-timeago
Advanced tools
react hooks for timeago.js
npm i @dh-react-hooks/use-timeago
props | type | required | default | description |
---|---|---|---|---|
dateTime | Date / number / string | true | undefined | start date |
options | object | false | undefined | options |
options | type | default | description |
---|---|---|---|
locale | string | en_US | locale |
localeRegister | function | undefined | custom local register function |
interval | number | 1000 | update interval duration in milliseconds |
const useTimeAgo = require('@dh-react-hooks/use-timeago')
const timeago = useTimeAgo.default(
Date.now(),
{
interval: 30000
}
)
import useTimeAgo from '@dh-react-hooks/use-timeago'
const timeago = useTimeAgo(
Date.now(),
{
interval: 30000
}
)
import useTimeAgo from '@dh-react-hooks/use-timeago'
const localeRegister: function(number, index) {
return [
['剛剛', '片刻後'],
['%s 秒前', '%s 秒後'],
['1 分鐘前', '1 分鐘後'],
['%s 分鐘前', '%s 分鐘後'],
['1 小時前', '1 小時後'],
['%s 小時前', '%s 小時後'],
['1 天前', '1 天後'],
['%s 天前', '%s 天後'],
['1 週前', '1 週後'],
['%s 週前', '%s 週後'],
['1 個月前', '1 個月後'],
['%s 個月前', '%s 個月後'],
['1 年前', '1 年後'],
['%s 年前', '%s 年後']
][index]
}
const timeago = useTimeAgo(
Date.now(),
{
locale: 'zh_TW',
localeRegister
}
)
FAQs
react hooks for timeago.js
We found that @dh-react-hooks/use-timeago 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.