⚡️ The Node.js API for open cloud
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
assets
lib
test
.gitignore
.npmignore
LICENSE
README.md
package.json
yarn.lock

README.md

NodeCloud

npm version Hex.pm Codacy Badge Build Status

NodeCloud is a standard library to get a single API on the open cloud with multiple providers. Making open cloud easily accessible and managed.

🚀 Install

npm install nodecloud
       or
yarn add nodecloud

📘 Service Providers

  • Amazon web services (AWS)
  • Google cloud platform (GCP)
  • Azure

📟 Service Types

Service Category Service AWS GCP Azure
Compute IaaS EC2 Compute Engine Virtual Machine
Containers ECS - -
Storage Object Storage S3 Cloud Storage Blob, Queue, Table
Block Storage EBS Persistent Disks
Networking Load Balancer ELB - Virtual Networks
Peering Direct Connect - Azure API
DNS Route53 Google DNS
Databases RDBMS RDS - Azure Database
NoSQL: key-value DynamoDB Cloud Datastore
NoSQL: indexed - Cloud Datastore
Security/ Authorization IAM AWS IAM - -
Utilities Apps management - - WebApps

✌️ How to setup

Make sure you have .nc.config.js file in the project root.

Content of .nc.config.js file is assumed as the following structure. It is an array of supported providers.

  1. name : It is the provider name which nodecloud-core supports.
  2. tag : It is the name that you will use to load the given provider. It is for your reference in code. It can be anything that you may like.
  3. libName : It is the name of the library which has to be installed before loading a provider.

This config file can contain array of objects for all providers and all will be loaded. Supported values for name : Azure, google, AWS

const providers = [
  {
    name: "aws",
    tag: "aws",
    libName: "nodecloud-aws-plugin"
  },
  {
    ... // For Google
  }
];

module.exports = providers;

Supported providers

📣 Usage

const nodeCloud = require("nodecloud");
// AWS
const ncProviders = nodeCloud.getProviders();
const options = {
  apiVersion: "2016-11-15"
};

const params = {
  ImageId: "ami-10fd7020", // amzn-ami-2011.09.1.x86_64-ebs
  InstanceType: "t1.micro",
  MinCount: 1,
  MaxCount: 1
};
const instanceParams = {
  Key: "Name",
  Value: "Node Cloud demo"
};

const ec2 = ncProviders.aws.compute(options);
ec2
  .createInstance(params, instanceParams)
  .then(res => {
    console.log(`All done ! ${res}`);
  })
  .catch(err => {
    console.log(`Oops something happened ${err}`);
  });

💻 Development setup

$ git clone https://github.com/cloudlibz/nodecloud
$ cd nodecloud
$ yarn install

✒️ Run unit tests

$ yarn test

📜 License

MIT