0.1.16 • Published 9 years ago

faux-knox v0.1.16

Weekly downloads
297
License
BSD
Repository
github
Last release
9 years ago

faux-knox

Build Status david-dm

A knox wrapper that allows you to use the local file system instead of S3

###Installation

npm install faux-knox

###Testing

npm test

###API

var knox = process.env.NODE_ENV === 'production'
           ? require('knox') : require('faux-knox');

var client = knox.createClient({
    bucket: 'local/filesystem/dir'
    //... other settings
});

//use client everywhere a regular knox client will be used.

####Implemented

#####list

function(options, callback)

callback(err, list)

list is an object with a Contents array containing the returned files.

#####getFile

function(uri, headers, callback)

callback(err, cres)

cres is a readable stream with headers attached.

#####putFile

function(from, to, callback)

callback(err, res)

from is the path to a local file to be read

to is the path to write the from bytes mounted in the bucket specified.

res.headers.statusCode is 200 on successful creation.

#####putBuffer

function(buffer, to, headers, callback)

callback(err, res)

buffer is the buffer to write

to is where the buffer is written

headers used by knox module, ignored here

res.headers.statusCode is 200 on successful creation.

#####deleteFile

function(file, callback)

callback(err, res)

file path in bucket to delete

res.headers.statusCode is 204 on successful deletion.

###TODO

All of the other knox functionality

0.1.16

9 years ago

0.1.15

10 years ago

0.1.14

10 years ago

0.1.13

10 years ago

0.1.12

10 years ago

0.1.11

10 years ago

0.1.9

10 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago