
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
metalsmith-just-a-moment
Advanced tools
A Metalsmith plugin which automatically converts all dates in files and metadata to moment.js objects.
Automatically converting all your date objects to moment.js objects allows you to have very simple access to moment.js formatting inside your templates.
npm install metalsmith-just-a-moment --save
metalsmith.json config example:
{
"plugins": {
// These are the default metalsmith-just-a-moment options, shown here only for demonstration.
"metalsmith-just-a-moment": {
pattern: ['**/*.md'],
scanFiles: true,
scanMetadata: true
}
}
}
Build script example:
var metalsmith = require('metalsmith');
var markdown = require('metalsmith-markdown');
var justAMoment = require('metalsmith-just-a-moment');
metalsmith(__dirname)
.source('src')
.destination('pub')
// These are the default metalsmith-just-a-moment options, shown here only for demonstration.
.use(justAMoment({
pattern: ['**/*.md'],
scanFiles: true,
scanMetadata: true
}))
.use(markdown({
gfm: true,
tables: true
}))
.build(function (err) {
if (err) {
throw err;
}
});
pattern
['**/*.md']scanFiles
scanMetadata
asUTC
metalsmith-permalinks won't like that your dates are already moment.js objects, if you are using metalsmith-permalinks use metalsmith-just-a-moment after, not before, or use a patched version of metalsmith-permalinks (with other fixes) here.
FAQs
A Metalsmith plugin to auto convert dates to moment objects.
The npm package metalsmith-just-a-moment receives a total of 1 weekly downloads. As such, metalsmith-just-a-moment popularity was classified as not popular.
We found that metalsmith-just-a-moment 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
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.