Node.js - markdown-walker
Simple directory walker that specifically looks for markdown files.
Why?
I use Markdown files for blogging, documentation, and pretty much every type of writing that I do. I'm starting to develop more and more utilities and that incorporate markdown so I wanted a module that encapsulates the finding of markdown.
Installation
npm install --save markdown-walker
Usage
The code is very simple. But it's essentially a modification of https://github.com/daaku/nodejs-walker except that it emits
markdown
events when it discovers files that have any of the following extensions: .md
, .markdown
, .mkd
.
Quick Example
var mdw = ; var walker = ;walker;walker;
API
constructor(dir, [options])
- dir: The directory to walk or search.
- options: Optional argument that only has one field:
lastModified
.lastModified
can either be aDate
object or anumber
that represents the number of milliseconds since the UNIX epoch, e.g:(new Date).getTime()
.
Example:
var mdw = var walker =
events
- markdown: Emitted when a markdown file is found.
- notModified: Only emmitted when
lastModified
is set and it doesn't meet the condition. - modified: Only emmitted when
lastModified
is set and it does meet the condition.
License
(MIT License)
Copyright 2012-2013 JP Richardson jprichardson@gmail.com