Skip to content

Like TehShrike/noddity-retrieval, but for the file system!

Notifications You must be signed in to change notification settings

ArtskydJ/noddity-fs-retrieval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Noddity FS Retrieval

Build Status

Implements the same api as noddity-retrieval, but retrieves from the file system instead of a server.

example

var Retrieval = require('noddity-fs-retrieval')
var Butler = require('noddity-butler')

var retrieve = new Retrieval('./content')
var butler = new Butler(retrieve, levelUpDb, opts)
var Retrieval = require('noddity-fs-retrieval')
var retrieve = new Retrieval('./content')

retrieve.getIndex(function(err, index) {
	if (!err && index.length > 0) {
		// Get the most recent post
		retrieve.getPost(index.pop(), function(err, post) {
			console.log("Found post named " + post.metadata.title)
			console.log("The words inside it are:\n" + post.content)
		})
	}
})

api

var Retrieval = require('noddity-fs-retrieval')

var retrieval = Retrieval(dir)

  • dir is the directory from which to serve the content.
  • Returns retrieval
    • retrieval.getIndex(cb)
      • cb(err, postsArray)
    • retrieval.getPost(filename, cb)
      • filename string, e.g. 'index.md', 'blog/2015/09/25.md'
      • cb(err, post)

license

VOL

About

Like TehShrike/noddity-retrieval, but for the file system!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published