fs-date-parser
Simple library to parse the date from a file-system path. (used for static site generators)
Last updated 5 years ago by leichtgewicht .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install fs-date-parser 
SYNC missed versions from official npm registry.

fs-date-parser

For static site blogs or pages you might want to setup the path to contain a date for sorting and publication. This little parser is fairly flexible and aimed exactly at this purpose.

Usage

Install the date parser using:

$ npm i fs-date-parser --save

Then you can use it just like

var parse = require('fs-date-parser');

parse('2015/06/09-hello.md'); // {date: /*Tue Jun 09 2015 00:00:00 GMT+0900 (JST)*/, rest: 'hello.md'}
parse('2015-06-09-hello.md'); // {date: /*Tue Jun 09 2015 00:00:00 GMT+0900 (JST)*/, rest: 'hello.md'}

parse('hello.md') // {date:}

(writing this from a japanese time-zone)

Current Tags

  • 1.0.0                                ...           latest (5 years ago)

1 Versions

  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (2)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |