The official QingStor SDK for the JavaScript programming language.
Clone or download
Xuanwo Bump to version 2.2.15
Signed-off-by: Xuanwo <xuanwo@yunify.com>
Latest commit 1da38bb Sep 25, 2018
Permalink
Failed to load latest commit information.
docs
scenarios
specs
src
template
test
.babelrc
.editorconfig
.esformatter
.eslintrc
.gitignore
.gitmodules Add scenarios and template, update package script Dec 3, 2016
.npmignore npmignore: Only include dist file for publish Nov 19, 2017
.travis.yml travis: Remove dist Apr 24, 2018
AUTHORS Enhance docs Dec 5, 2016
CHANGELOG.md
LICENSE
README.md
gulpfile.js
index.js
package-lock.json
package.json
webpack.config.js

README.md

QingStor SDK for JavaScript

travis-ci api-reference license

NPM

The official QingStor SDK for the JavaScript programming language.

Getting Started

Installation

Refer to the Installation Guide, and have this SDK installed.

Preparation

Before your start, please go to QingCloud Console to create a pair of QingCloud API AccessKey.

API AccessKey Example:

access_key_id: 'ACCESS_KEY_ID_EXAMPLE'
secret_access_key: 'SECRET_ACCESS_KEY_EXAMPLE'

Usage

Now you are ready to code. You can read the detailed guides in the list below to have a clear understanding or just take the quick start code example. Checkout our releases and change logs for information about the latest features, bug fixes and new ideas.

Used in node with callback:

import { Config, QingStor } from 'qingstor-sdk';
let config = new Config('ACCESS_KEY_ID_EXAMPLE', 'SECRET_ACCESS_KEY_EXAMPLE');
let bucket = new QingStor(config).Bucket('example_bucket', 'pek3a');
bucket.listObjects(function (err, data) {
  console.log(data.statusCode);
  console.log(data.keys);
});

or Used in node with promise/A+

import { Config, QingStor } from 'qingstor-sdk';
let config = new Config('ACCESS_KEY_ID_EXAMPLE', 'SECRET_ACCESS_KEY_EXAMPLE');
let bucket = new QingStor(config).Bucket('example_bucket', 'pek3a');
bucket.listObjects().then((data) => {
  console.log(data.statusCode);
  console.log(data.keys);
});

Used in Browser:

Firstly, you should refer qingstor-sdk javascript files qingstor-sdk.min.js

<script src='qingstor-sdk.min.js'></script>

After that, qingstor_sdk will be exported to browser's windows, so that you can use qingstor_sdk directly.

You can use all functions in node way with callback.

let config = new qingstor_sdk.Config('ACCESS_KEY_ID_EXAMPLE', 'SECRET_ACCESS_KEY_EXAMPLE');
let bucket = new qingstor_sdk.QingStor(config).Bucket('example_bucket', 'pek3a');
bucket.listObjects(function (err, data) {
  console.log(data.statusCode);
  console.log(data.keys);
});

or Used in browser with promise/A+

let config = new qingstor_sdk.Config('ACCESS_KEY_ID_EXAMPLE', 'SECRET_ACCESS_KEY_EXAMPLE');
let bucket = new qingstor_sdk.QingStor(config).Bucket('example_bucket', 'pek3a');
bucket.listObjects().then((data) => {
  console.log(data.statusCode);
  console.log(data.keys);
});

Reference Documentations

Contributing

Please see Contributing Guidelines of this project before submitting patches.

LICENSE

The Apache License (Version 2.0, January 2004).