New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

frontmatter-date-setter

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

frontmatter-date-setter

Set YAML frontmatter file creation and modified dates using git date information

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Frontmatter Date Setter

frontmatter-date-setter is released under the MIT license. Current npm package version. Downloads per month on npm. Total downloads on npm. PRs welcome! Follow @MrMartineau

ExampleInstallationUsageDemo

This package adds git file creation and modification dates to yaml frontmatter. Give it a directory and some file extensions and it will do the rest.

If a creation or modification date is already present, they will be updated if they don't match.

Example

Input

---
title: Frontmatter Date Setter
---

Output

---
title: Frontmatter Date Setter
created: 2020-03-22T14:53:49.000Z
modified: 2020-03-22T14:53:49.000Z
---

Installation

yarn add frontmatter-date-setter
# or
npm install frontmatter-date-setter

For CLI use you may want to install it globally

yarn global add frontmatter-date-setter
# or
npm install -g frontmatter-date-setter

Usage

Node

const fds = require('frontmatter-date-setter')

fds({
  directory: './tests',
  fileExtension: ['.md', '.mdx'],
  debug: true,
})

CLI

  Usage
    $ frontmatter-date-setter <input>
    $ fds <input>

  Options
    --directory, -d  The directory of the files to add dates to
    --fileExtension, -ext  The file extensions that you wish to add dates to
    --debug Turn on debugging messages

  Examples
    $ frontmatter-date-setter --directory="notes" --fileExtension=.md  --fileExtension=.mdx
    $ fds --directory="notes" --fileExtension=.md  --fileExtension=.mdx
CLI Example
frontmatter-date-setter --directory="notes" --fileExtension=md  --fileExtension=mdx
fds --directory="tests" --fileExtension=.txt --fileExtension=.md --fileExtension=.yml --debug

License

MIT © Zander Martineau

Made by Zander • zander.wtfGitHubTwitter

Keywords

FAQs

Package last updated on 06 Dec 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc