0.5.0 • Published 7 years ago

find-posts v0.5.0

Weekly downloads
3
License
GPL-3.0
Repository
github
Last release
7 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

7 years ago

0.4.4

7 years ago

0.4.3

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago