Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including nec-sdk with all npm packages installed. Try it out:

var necSdk = require("nec-sdk")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

nec-sdk v1.0.2

NetEase Cloud SDK for JavaScript

NetEase Cloud SDK for JavaScript in Node.js

Since there's no official NetEase Cloud SDK for JavaScript, I stole aws-sdk-js and made this crappy port.

Installing in Node.js

npm install nec-sdk

Usage and Getting Started

This SDK is very similar to AWS SDK.

You can find a getting started guide for AWS SDK at:

http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/

Supported Services

Currently only NOS (Netease Object Storage) is supported. And the API definitions is just a copy of AWS S3, with metadata and default config modified.

Samples

var NEC = require('nec-sdk');

NEC.config.update({ accessKeyId: 'akid', secretAccessKey: 'secret' });

var nos = new NEC.NOS();

nos.putObject({
  Bucket: 'myBucket',
  Key: 'myKey',
  Body: 'Hello!'
}, function(err, data) {
  if (err) {
    console.log(err);
  } else {
    console.log('Successfully uploaded data to myBucket/myKey');
  }
});

License

The license of AWS SDK JS is Apache License, Version 2.0. And this SDK is distributed under the same licence.

It seems the license asks me to list all modified files, they are:

  • .gitignore
  • apis/metadata.json
  • lib/aws.js
  • lib/signers/request_signer.js
  • NOTICE.txt
  • package.json
  • README.md

And I add a few files of my own, they are:

  • apis/nos-2010-12-05.min.json
  • lib/signers/nos.js

I'm not quite familiar with the license. Please let me know if I did something wrong. Thank you!

Change Log

  • 2015-05-05 v1.0.2
    • Update README.
    • NOS: Allow x-nos-* header features.
  • 2015-02-05 v1.0.1
    • NOS: Allow slashes in object key.
  • 2015-02-04 v1.0.0
    • Add NOS API.

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free