
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy 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
The npm package @dh-react-hooks/use-timeago receives a total of 7 weekly downloads. As such, @dh-react-hooks/use-timeago popularity was classified as not popular.
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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.