Socket
Socket
Sign inDemoInstall

md-date

Package Overview
Dependencies
58
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    md-date

get date from markdown article


Version published
Weekly downloads
3
increased by200%
Maintainers
1
Install size
4.93 MB
Created
Weekly downloads
 

Readme

Source

md-date

NPM version Build Status Coveralls Status Dependency Status

get date from markdown article

Install

npm install --save md-date

Usage

import getDate from 'md-date';

const input = `
# title

21 asd qwe

22 *Dec* 2016

23 December 2016

24 Décembre 2016`;

getDate('DD MMM YYYY',  'en', input).text;   // 21 Dec 2016
getDate('DD MMM YYYY',  'en', input).html;   // 22 <em>Dec</em> 2016
getDate('DD MMM YYYY',  'en', input).unix;   // 1482364800
getDate('DD MMMM YYYY', 'en', input).text;   // 23 December 2016
getDate('DD MMMM YYYY', 'fr', input).text;   // 24 Décembre 2016
getDate('DD MMMM YYYY', 'en', input).moment; // moment instance
getDate('DD MMMM YYYY', 'en', input).node;   // MDAST node, see remark API
getDate('DD MMMM YYYY', 'en', '');           // undefined

API

getDate(format, locale, input)

format

Required
Type: String

Momentjs format for date, e.g. DD MMMM YYYY.

locale

Required
Type: String

One of 83 available in momentjs locales, e.g. en or fr.

input

Required
Type: String

Markdown string.

  • md-article - extract data from your markdown article
    • md-content - get content from markdown article
    • md-tags - get tags from markdown article
    • md-title - get title from markdown article

License

MIT © Aleksandr Filatov

Keywords

FAQs

Last updated on 21 Jul 2016

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc