This package has been deprecated

Author message:

faux-knox is now being maintained and faux-knox-2 has been deprecated.

faux-knox-2

0.1.9 • Public • Published

faux-knox-2

[Build Status] (https://travis-ci.org/AppPress/node-faux-knox-2) david-dm

A mock knox wrapper

Froked from https://github.com/wlaurance/faux-knox

###Installation

npm install faux-knox-2

###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

#####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 201 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 201 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

Readme

Keywords

Package Sidebar

Install

npm i faux-knox-2

Weekly Downloads

1

Version

0.1.9

License

BSD

Last publish

Collaborators