New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

minio

Package Overview
Dependencies
Maintainers
4
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minio - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

dist/main/stat-object.js

25

API.md

@@ -11,3 +11,5 @@ ## API Documentation

accessKey: 'YOUR-ACCESSKEYID',
secretKey: 'YOUR-SECRETACCESSKEY'
secretKey: 'YOUR-SECRETACCESSKEY',
secure: true,
port: 443,
})

@@ -67,11 +69,11 @@ ```

__Arguments__
* `callback(err, bucketStream)` _function_ - callback function with error as the first argument. `bucketStream` is the stream emitting bucket information.
* `callback(err, buckets)` _function_ - callback function with error as the first argument. `buckets` is an array of bucket information
`bucketStream` emits Object with the format:
`buckets` array element:
* `bucket.name` _string_ : bucket name
* `bucket.creationDate` _Date_: date when bucket was created
* `bucket.creationDate` _string_: date when bucket was created
__Example__
```js
s3Client.listBuckets(function(e, bucketStream) {
s3Client.listBuckets(function(e, buckets) {
if (e) {

@@ -81,11 +83,3 @@ console.log(e)

}
bucketStream.on('data', function(obj) {
console.log(obj)
})
bucketStream.on('end', function() {
console.log('End')
})
bucketStream.on('error', function(e) {
console.log('Error', e)
})
console.log('buckets: ' + buckets)
})

@@ -394,3 +388,4 @@ ```

* `objectName` _string_: name of the object.
* `expiry` _number_: expiry in seconds.
* `expiry` _number_: expiry in seconds (optional, default 7 days)
* `respHeaders` _object_: response headers to override (optional)
* `callback(err, presignedUrl)` _function_: callback function is called with non `null` value in case of error. `presignedUrl` will be the URL using which the object can be downloaded using GET request.

@@ -397,0 +392,0 @@

4

dist/main/errors.js

@@ -23,3 +23,3 @@ /*

var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };

@@ -259,2 +259,2 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

exports.S3Error = S3Error;
//# sourceMappingURL=errors.js.map
//# sourceMappingURL=errors.js.map

@@ -276,2 +276,2 @@ /*

}
//# sourceMappingURL=helpers.js.map
//# sourceMappingURL=helpers.js.map

@@ -52,2 +52,2 @@ /*

}
//# sourceMappingURL=s3-endpoints.js.map
//# sourceMappingURL=s3-endpoints.js.map

@@ -297,4 +297,12 @@ /*

var path = request.path + '?' + requestQuery.join('&');
var resource = request.path.split('?')[0];
var query = request.path.split('?')[1];
if (query) {
query = query + '&' + requestQuery.join('&');
} else {
query = requestQuery.join('&');
}
var path = resource + '?' + query;
var canonicalRequest = getCanonicalRequest(request.method, path, request.headers, signedHeaders, hashedPayload);

@@ -308,2 +316,2 @@

}
//# sourceMappingURL=signing.js.map
//# sourceMappingURL=signing.js.map

@@ -193,2 +193,3 @@ /*

this.push(null);
cb();
});

@@ -241,2 +242,2 @@ }

}
//# sourceMappingURL=transformers.js.map
//# sourceMappingURL=transformers.js.map

@@ -223,2 +223,2 @@ /*

}
//# sourceMappingURL=xml-parsers.js.map
//# sourceMappingURL=xml-parsers.js.map
{
"name": "minio",
"version": "2.0.0",
"version": "2.0.1",
"description": "S3 Compatible Cloud Storage client",

@@ -5,0 +5,0 @@ "main": "./dist/main/minio.js",

@@ -1,7 +0,14 @@

# Minio JavaScript Library for Amazon S3 Compatible Cloud Storage [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/minio/minio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# Minio JavaScript Library for Amazon S3 Compatible Cloud Storage [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Minio/minio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![NPM](https://nodei.co/npm/minio.png)](https://nodei.co/npm/minio/)
## Install from npm
The Minio JavaScript Client SDK provides simple APIs to access any Amazon S3 compatible object storage server.
This quickstart guide will show you how to install the client SDK and execute an example JavaScript program. For a complete list of APIs and examples, please take a look at the [JavaScript Client API Reference](https://docs.minio.io/docs/javascript-client-api-reference) documentation.
This document assumes that you have a working [nodejs](http://nodejs.org/) setup in place.
## Download from NPM
```sh

@@ -11,3 +18,3 @@ $ npm install --save minio

### Install from source
## Download from Source

@@ -20,106 +27,129 @@ ```sh

```
## Initialize Minio Client
You need five items in order to connect to Minio object storage server.
## Example in node
| Params | Description |
| :------- | :------------ |
| endPoint | URL to object storage service. |
|port| TCP/IP port number. This input is optional. Default value set to ``80`` for HTTP and ``443`` for HTTPs.|
| accessKey | Access key is like user ID that uniquely identifies your account. |
| secretKey | Secret key is the password to your account. |
|secure |Set this value to 'true' to enable secure (HTTPS) access |
```js
#!/usr/bin/env node
var Minio = require('minio')
var s3Client = new Minio({
endPoint: 's3.amazonaws.com',
accessKey: 'YOUR-ACCESSKEYID',
secretKey: 'YOUR-SECRETACCESSKEY'
})
s3Client.listBuckets(function(e, bucketStream) {
if (e) {
console.log(e)
return
}
bucketStream.on('data', function(obj) {
console.log(obj)
})
bucketStream.on('end', function() {
console.log("End")
})
bucketStream.on('error', function(e) {
console.log("Error", e)
})
})
var minioClient = new Minio({
endPoint: 'play.minio.io',
port: '9000',
secure: true,
accessKey: 'Q3AM3UQ867SPQQA43P2F',
secretKey: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG'
});
```
## Quick Start Example - File Uploader
This example program connects to an object storage server, makes a bucket on the server and then uploads a file to the bucket.
## Example in browser
We will use the Minio server running at [https://play.minio.io:9000](https://play.minio.io:9000) in this example. Feel free to use this service for testing and development. Access credentials shown in this example are open to the public.
```html
<!doctype html>
<html>
<body>
<script type="text/javascript" src="<your-cdn>/minio-browser.js"></script>
<script>
var s3Client = new Minio({
endPoint: 's3.amazonaws.com',
accessKey: 'YOUR-ACCESSKEYID',
secretKey: 'YOUR-SECRETACCESSKEY'
});
#### file-uploader.js
```js
var Minio = require('minio')
s3Client.getObject('krisupload', '40mbfile', function(e, dataStream) {
if (e) {
return console.log(e)
}
dataStream.on('data', function(chunk) {
console.log(chunk.toString())
})
})
</script>
</body>
</html>
```
// Instantiate the minio client with the endpoint
// and access keys as shown below.
var minioClient = new Minio({
endPoint: 'play.minio.io',
port: 9000,
secure: true,
accessKey: 'Q3AM3UQ867SPQQA43P2F',
secretKey: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG'
});
## Documentation
// File that needs to be uploaded.
var file = '/tmp/photos-europe.tar'
[API documentation](API.md)
// Make a bucket called europetrip.
minioClient.makeBucket('europetrip', 'us-east-1', function(err) {
if (err) return console.log(err)
## Examples
console.log('Bucket created successfully in "us-east-1".')
// Using fPutObject API upload your file to the bucket europetrip.
minioClient.fPutObject('europetrip', 'photos-europe.tar', file, 'application/octet-stream', function(err, etag) {
if (err) return console.log(err)
console.log('File uploaded successfully.')
});
});
```
#### Run file-uploader
```bash
$ node file-uploader.js
Bucket created successfully in "us-east-1".
### Bucket
$ mc ls play/europetrip/
[2016-05-25 23:49:50 PDT] 17MiB photos-europe.tar
```
[makeBucket(bucket, region, cb)](examples/make-bucket.js)
## API Reference
The full API Reference is available here.
* [Complete API Reference](https://docs.minio.io/docs/javascript-client-api-reference)
[listBuckets() : Stream](examples/list-buckets.js)
### API Reference : Bucket Operations
* [`makeBucket`](https://docs.minio.io/docs/javascript-client-api-reference#makeBucket)
* [`listBuckets`](https://docs.minio.io/docs/javascript-client-api-reference#listBuckets)
* [`bucketExists`](https://docs.minio.io/docs/javascript-client-api-reference#bucketExists)
* [`removeBucket`](https://docs.minio.io/docs/javascript-client-api-reference#removeBucket)
* [`listObjects`](https://docs.minio.io/docs/javascript-client-api-reference#listObjects)
* [`listIncompleteUploads`](https://docs.minio.io/docs/javascript-client-api-reference#listIncompleteUploads)
[bucketExists(bucket, cb)](examples/bucket-exists.js)
### API Reference : File Object Operations
* [`fPutObject`](https://docs.minio.io/docs/javascript-client-api-reference#fPutObject)
* [`fGetObject`](https://docs.minio.io/docs/javascript-client-api-reference#fGetObject)
[removeBucket(bucket, cb)](examples/remove-bucket.js)
### API Reference : Object Operations
* [`getObject`](https://docs.minio.io/docs/javascript-client-api-reference#getObject)
* [`putObject`](https://docs.minio.io/docs/javascript-client-api-reference#putObject)
* [`statObject`](https://docs.minio.io/docs/javascript-client-api-reference#statObject)
* [`removeObject`](https://docs.minio.io/docs/javascript-client-api-reference#removeObjec)
* [`removeIncompleteUpload`](https://docs.minio.io/docs/javascript-client-api-reference#removeIncompleteUpload)
[listObjects(bucket, prefix, recursive) : Stream](examples/list-objects.js)
### API Reference : Presigned Operations
* [`presignedGetObject`](https://docs.minio.io/docs/javascript-client-api-reference#presignedGetObject)
* [`presignedPutObject`](https://docs.minio.io/docs/javascript-client-api-reference#presignedPutObject)
* [`presignedPostPolicy`](https://docs.minio.io/docs/javascript-client-api-reference#presignedPostPolicy)
[listIncompleteUploads(bucket, prefix, recursive) : Stream](examples/list-incomplete-uploads.js)
### Object
[fGetObject(bucket, object, filePath)](examples/fget-object.js)
## Full Examples
[getObject(bucket, object) Stream](examples/get-object.js)
#### Full Examples : Bucket Operations
* [list-buckets.js](./examples/list-buckets.js)
* [list-objects.js](./examples/list-objects.js)
* [bucket-exists.js](./examples/bucket-exists.js)
* [make-bucket.js](./examples/make-bucket.js)
* [remove-bucket.js](./examples/remove-bucket.js)
* [list-incomplete-uploads.js](./examples/list-incomplete-uploads.js)
[getPartialObject(bucket, object, offset, length) Stream](examples/get-partialobject.js)
#### Full Examples : File Object Operations
* [fput-object.js](./examples/fput-object.js)
* [fget-object.js](./examples/fget-object.js)
[fPutObject(bucket, object, filePath, contentType, cb)](examples/put-object.js)
#### Full Examples : Object Operations
* [put-object.js](./examples/put-object.js)
* [get-object.js](./examples/get-object.js)
* [get-partialobject.js](./examples/get-partialobject.js)
* [remove-object.js](./examples/remove-object.js)
* [stat-object.js](./examples/stat-object.js)
[putObject(bucket, object, Stream, contentType, cb)](examples/put-object.js)
#### Full Examples : Presigned Operations
* [presigned-getobject.js](./examples/presigned-getobject.js)
* [presigned-putobject.js](./examples/presigned-putobject.js)
* [presigned-postpolicy.js](./examples/presigned-postpolicy.js)
[statObject(bucket, object, cb)](examples/stat-object.js)
## Explore Further
* [Complete Documentation](https://docs.minio.io)
* [Minio JavaScript Client SDK API Reference](https://docs.minio.io/docs/javascript-client-api-reference)
* [Build your own Shopping App Example- Full Application Example ](https://docs.minio.io/docs/javascript-shopping-app)
[removeObject(bucket, object, cb)](examples/remove-object.js)
[removeIncompleteUpload(bucket, object, cb)](examples/remove-incomplete-upload.js)
### Presigned
[presignedGetObject(bucket, object, expires, cb)](examples/presigned-getobject.js)
[presignedPutObject(bucket, object, expires, cb](examples/presigned-putobject.js)
[presignedPostPolicy(postPolicy, cb)](examples/presigned-postpolicy.js)
## Contribute

@@ -130,2 +160,2 @@

[![Build Status](https://travis-ci.org/minio/minio-js.svg)](https://travis-ci.org/minio/minio-js)
[![Build status](https://ci.appveyor.com/api/projects/status/402thana800k00fv?svg=true)](https://ci.appveyor.com/project/harshavardhana/minio-js)
[![Build status](https://ci.appveyor.com/api/projects/status/1d05e6nvxcelmrak?svg=true)](https://ci.appveyor.com/project/harshavardhana/minio-js)

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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