Coder Social home page Coder Social logo

nodecloud-core's Introduction

Node Cloud Logo

NodeCloud

npm version Hex.pm Codacy Badge Build Status

NodeCloud is a standard library to get a single API among common cloud service providers (Ex. AWS, GCP, Azure.. ). This will make building products among multiple cloud services and its services easier for the developer.

Install

npm install nodecloud
       or
yarn add nodecloud

Service Providers

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

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

Usage

Quick Start Guide

Note:

Please make sure you have .nc.config file in the project root and have nodecloud-core installed.

Content of .nc.config file is assumed as the following json 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: "Azure",
    tag: "azure",
    libName: "nodecloud-azure"
  },
  {
    ... // For Google
  }
];

module.exports = providers;
const nodeCloud = require("nodecloud");
// AWS
const ncAWS = nodeCloud.getProvider("AWS");
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 = ncAWS.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

nodecloud-core's People

Contributors

rajikaimal avatar raju249 avatar rehrumesh avatar

Watchers

 avatar

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.