Librarian!

Version 1.0.0 of Librarian has been released!

You can use Librarian as a standalone site, or as a peice of a larger puzzle.

To use it as a standalone site, clone the github repository and start the application.

$ git clone https://github.com/librarianjs/librarian
$ npm install
$ PORT=<your port here> npm start

To use as a piece of a larger site, just include the librarian module.

$ npm install librarian
var express = require( 'express' )  
var app = express()  
var librarian = require( 'librarian' )  
app.get( '/', function( req, res ){  
    res.send( 'hello!' )
} )

app.use( '/files', librarian() )

app.listen( 8888 )  

Librarian is platform agnostic for both file and metadata storage. The library defaults to using sqlite for metadata and a folder called ./files for file storage.

If you want to replace either of these functions, pass them is as options. The defaults would look like this if passed explicitly.

var librarian = require( 'librarian' )  
var LocalStorage = require( 'librarian-local-storage' )  
var LocalMeta = require( 'librarian-local-meta' )  
var app = librarian({  
    storageEngine: new LocalStorage(),
    metadataEngine: new LocalMeta()
})

app.listen( '8888', function(){  
    console.log( 'Librarian is listening with defaults on 8888' )
})

If you want to use your own metadata or storage, make sure your engine follows the Storage and Metadata engine spec.