
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
@nuxtjs/date-fns
Advanced tools
Modern JavaScript date utility library - date-fns for Nuxt.js
@nuxtjs/date-fns dependency to your projectyarn add --dev @nuxtjs/date-fns # or npm install --save-dev @nuxtjs/date-fns
@nuxtjs/date-fns to the buildModules section of nuxt.config.jsexport default {
buildModules: [
// Simple usage
'@nuxtjs/date-fns',
// With options
['@nuxtjs/date-fns', { /* module options */ }]
]
}
:warning: If you are using Nuxt < v2.9 you have to install the module as a dependency (No --dev or --save-dev flags) and use modules section in nuxt.config.js instead of buildModules.
export default {
buildModules: [
'@nuxtjs/date-fns'
],
dateFns: {
/* module options */
}
}
Add the types to your "types" array in tsconfig.json after the @nuxt/types entry.
:warning: Use @nuxt/vue-app instead of @nuxt/types for nuxt < 2.9.
{
"compilerOptions": {
"types": [
"@nuxt/types",
"@nuxtjs/date-fns"
]
}
}
Why?
For typescript to be aware of the additions to the
nuxt Context, thevue instanceand thevuex store, the types need to be merged via declaration merging by adding@nuxtjs/date-fnsto your types.
localesArray[String][]Locales to be imported.
defaultLocaleStringnullYou can preset default locale.
formatStringnullYou can preset default format.
methodsArraynullMethods to be imported. If not defined all methods are imported.
This module inject $dateFns to your project:
<template>
<div>
// Using default format and locale
{{ $dateFns.format(new Date()) }}
// Using custom format
{{ $dateFns.format(new Date(), 'yyyy-MM-dd') }}
// Using custom format and locale
{{ $dateFns.format(new Date(), 'yyyy-MM-dd', { locale: 'ru' }) }}
// Using asyncData
{{ dateFormatted }}
</div>
</template>
<script>
export default {
asyncData({ $dateFns }) {
return {
dateFormatted: $dateFns.format(new Date())
}
}
}
</script>
yarn install or npm installnpm run devCopyright (c) Nuxt Community
FAQs
Modern JavaScript date utility library - date-fns for Nuxt.js
The npm package @nuxtjs/date-fns receives a total of 357 weekly downloads. As such, @nuxtjs/date-fns popularity was classified as not popular.
We found that @nuxtjs/date-fns 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
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.