0.5.0 • Published 9 years ago

find-posts v0.5.0

Weekly downloads
3
License
GPL-3.0
Repository
github
Last release
9 years ago

find-posts

Finds and parses posts in specific directories with specific names.

Installation

npm i --save find-posts

Usage

const findAllPosts = require('find-posts/find-all-posts.js');

findAllPosts({
  dirs: [
    {
      path: path.resolve(cwd, './posts/foo/'),
      regexes: [ /^(\d\d\d\d)-(\d\d)-(\d\d)-(.*)\.html\.md$/; ],
    },
    {
      path: path.resolve(cwd, './posts/bar/'),
      regexes: [ /^(.+)\.html$/ ],
    }
  ],
})
.then((data) => {
  // look in data for posts
});

A post is any file whose name matches the specified pattern, found within the speicified directory, and contains front matter that is parseable by front-matter.

Author

Brendan Graetz

Licence

GPL-3.0

0.5.0

9 years ago

0.4.4

9 years ago

0.4.3

10 years ago

0.4.2

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago