Code Monkey home page Code Monkey logo

nodecloud's Introduction

NodeCloud

npm version 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

  • *yet to be implemented
Service Category Service AWS GCP Azure
Compute IaaS EC2 Compute Engine Virtual Machine
Containers ECS - -
Kubernetes* EKS Kubernetes Engine AKS
Storage Object Storage S3 Cloud Storage Blob, Queue, Table, Files*
Block Storage EBS Persistent Disks
Networking Load Balancer ELB GC Load Balancing* Virtual Networks
Peering Direct Connect Direct Peering*, Carrier Peering* Azure API
DNS Route53 Google DNS Azure DNS*
Databases RDBMS RDS Cloud SQL* 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 : Provider identifier, this can be used to identify the plugin at a glance.
  2. tag : Tag name that will be used to load the given provider internally.
  3. plugin : Plugin module

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

const nodeCloudAwsPlugin = require("nodecloud-aws-plugin");

const providers = [
  {
    name: "aws",
    tag: "aws",
    plugin: nodeCloudAwsPlugin
  }
];

module.exports = providers;

๐Ÿ“ฃ Usage

const nodeCloud = require("nodecloud");
const optionsProvider = {
  overrideProviders: false
};
const ncProviders = nodeCloud.getProviders(optionsProvider);
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}`);
  });

Override providers

NodeCloud officialy supports AWS, GCP and Azure. If you want to use a community driven plugin override the providers list as follows.

const nodeCloud = require("nodecloud");
const options = {
  overrideProviders: true
};
const ncProviders = nodeCloud.getProviders(options);

๐Ÿ’ป Development setup

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

โœ’๏ธ Run unit tests

$ yarn test

๐Ÿ“œ License

MIT

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.