Code Monkey home page Code Monkey logo

mock-aws-s3's Introduction

Mock AWS S3 SDK

This is a very simple interface that mocks the AWS SDK for Node.js. The implementation is incomplete but most basic features are supported.

Available:

  • createBucket
  • listObjects
  • deleteObjects
  • deleteObject
  • getObject
  • headObject
  • putObject
  • copyObject
  • upload

It uses a directory to mock a bucket and its content.

If you'd like to see some more features or you have some suggestions, feel free to use the issues or submit a pull request.

Release History

  • 2017-02-02   v2.4.0   Account for no existing keys when getting an object by @derPuntigamer
  • 2016-06-03   v2.3.0   Add createBucket method and tests by @neilstuartcraig
  • 2016-05-25   v2.2.1   Add Size attribute by @aldafu
  • 2016-04-25   v2.2.0   Add MaxKey options in listObject by @hauboldj
  • 2016-01-18   v2.1.0   Fix markers on listObjects (by @wellsjo) and add send method (by @AllieRays and @IonicaBizau)
  • 2015-11-04   v2.0.0   Static basePath configuration, bound params (by @CJNE) and match upload API (by @kyleseely)
  • 2015-10-25   v1.1.0   Removed because of potential breaking change with bound params
  • 2015-09-24   v1.0.0   Breaking changes and awesome PR to fix API inconsistencies by @irothschild
  • 2015-08-27   v0.5.0   Refactor and default options by @whitingj
  • 2015-07-28   v0.4.0   Add headObject method by @mdlavin
  • 2015-07-21   v0.3.0   Add CommonPrefixes to listObjects by @jakepruitt
  • 2015-03-15   v0.2.7   Mock out AWS' config submodule by @necaris
  • 2015-03-13   v0.2.6   Partial match support and ContentLength by @mick
  • 2015-03-03   v0.2.5   Allow string and fix tests by @lbud
  • 2015-02-05   v0.2.4   Fix url encoding for copy by @ahageali
  • 2015-01-22   v0.2.3   Support for copyObject
  • 2014-02-02   v0.2.1   Support for deleteObject
  • 2014-01-08   v0.2.0   Support streams for getObject/putObject
  • 2013-10-24   v0.1.2   Fix isTruncated typo
  • 2013-10-09   v0.1.1   Add LastModified to listObject
  • 2013-08-09   v0.1.0   First release

Example

var AWSMock = require('mock-aws-s3');
AWSMock.config.basePath = '/tmp/buckets/' // Can configure a basePath for your local buckets
var s3 = AWSMock.S3({
	params: { Bucket: 'example' }
});
s3.putObject({Key: 'sea/animal.json', Body: '{"is dog":false,"name":"otter","stringified object?":true}'}, function(err, data) {
	s3.listObjects({Prefix: 'sea'}, function (err, data) {
		console.log(data);
	});
});

mock-aws-s3's People

Contributors

mathieuloutre avatar whitingj avatar cjne avatar verdier avatar wellsjo avatar hauboldj avatar mdlavin avatar necaris avatar ahageali avatar aldafu avatar puinenveturi avatar ionicabizau avatar mick avatar neilstuartcraig avatar allierays avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.