Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

faux-knox

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

faux-knox

Mock requests to knox module using file system

  • 0.1.14
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
244
decreased by-46.96%
Maintainers
3
Weekly downloads
 
Created
Source

faux-knox

[Build Status] (https://travis-ci.org/AppPress/node-faux-knox) 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 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

Keywords

FAQs

Package last updated on 12 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc