Skip to content

Commit c1c5a4c

Browse files
committed
Updated Readme
1 parent 9ab331a commit c1c5a4c

2 files changed

Lines changed: 95 additions & 95 deletions

File tree

README.md

Lines changed: 86 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -19,37 +19,37 @@
1919

2020
Table of Content
2121

22-
- [Introduction](#introduction)
23-
- [Supported Service Providers](#-supported-service-providers)
24-
- [Getting Started](#getting-started)
25-
- [NodeCloud Plugins](#nodecloud-plugins)
26-
- [Example](#example)
27-
- [Overriding Providers](#overriding-providers)
28-
- [Service Types](#-service-types)
29-
- [Development setup](#-development-setup)
30-
- [Important Notes for Developers](#important-notes-for-developers-)
31-
- [Test Changes](#test-changes)
32-
- [NodeCloud Code Generation tool](#nodecloud-code-generation-tool)
33-
- [License](#-license)
22+
- [Introduction](#introduction)
23+
- [Supported Service Providers](#-supported-service-providers)
24+
- [Getting Started](#getting-started)
25+
- [NodeCloud Plugins](#nodecloud-plugins)
26+
- [Example](#example)
27+
- [Overriding Providers](#overriding-providers)
28+
- [Service Types](#-service-types)
29+
- [Development setup](#-development-setup)
30+
- [Important Notes for Developers](#important-notes-for-developers-)
31+
- [Test Changes](#test-changes)
32+
- [NodeCloud Code Generation tool](#nodecloud-code-generation-tool)
33+
- [License](#-license)
3434

3535
# Introduction
3636

3737
**`NodeCloud ☁️`** is a standard library to get a single API on the open cloud with multiple providers. It is a NodeJs library which comes with plugins for each cloud provider. NodeCloud's aim is to abstract away the differences between different cloud providers. It provides an easy to use API for developers in order to interact with different cloud providers.
3838

3939
NodeCloud will be useful to you if:
4040

41-
- you work on a project which uses multiple cloud providers
42-
- you are looking for an abstract cloud API which can switch between cloud providers with fewer code changes
43-
- you are an open-source enthusiast who is into cloud engineering or code generation
44-
- you want to improve your skills in NodeJS, Typescript and cloud service providers
41+
- you work on a project which uses multiple cloud providers
42+
- you are looking for an abstract cloud API which can switch between cloud providers with fewer code changes
43+
- you are an open-source enthusiast who is into cloud engineering or code generation
44+
- you want to improve your skills in NodeJS, Typescript and cloud service providers
4545

4646
## 📘 Supported Service Providers
4747

48-
- Amazon Web Services (AWS)
49-
- Azure
50-
- Google Cloud Platform (GCP)
51-
- DigitalOcean
52-
- AliCloud
48+
- Amazon Web Services (AWS)
49+
- Azure
50+
- Google Cloud Platform (GCP)
51+
- DigitalOcean
52+
- AliCloud
5353

5454
_📢 if your required cloud provider plugin is not listed here, we'd love your help to add it :)_
5555

@@ -95,37 +95,37 @@ This config file can contain an array of objects for all providers and all will
9595
### Example
9696

9797
```js
98-
const nodeCloudAwsPlugin = require("@nodecloud/aws-plugin");
99-
const nodeCloudGcpPlugin = require("@nodecloud/gcp-plugin");
100-
const nodeCloudAzurePlugin = require("@nodecloud/azure-plugin");
101-
const nodeCloudDoPlugin = require("@nodecloud/do-plugin");
98+
const nodeCloudAwsPlugin = require('@nodecloud/aws-plugin');
99+
const nodeCloudGcpPlugin = require('@nodecloud/gcp-plugin');
100+
const nodeCloudAzurePlugin = require('@nodecloud/azure-plugin');
101+
const nodeCloudDoPlugin = require('@nodecloud/do-plugin');
102102

103103
const providers = [
104-
{
105-
name: "aws",
106-
tag: "aws",
107-
plugin: nodeCloudAwsPlugin,
108-
configPath: "C:\\Users\\Rajitha\\opensource\\aws_cred.json"
109-
},
110-
{
111-
name: "google",
112-
tag: "google",
113-
plugin: nodeCloudGcpPlugin,
114-
configPath: {
115-
projectId: "astral-hold-276807",
116-
keyFilename: "C:\\Users\\Rajitha\\opensource\\gcp_cred.json"
117-
}
118-
},
119-
{
120-
name: "azure",
121-
tag: "azure",
122-
plugin: nodeCloudAzurePlugin
123-
},
124-
{
125-
name: "digitalocean",
126-
tag: "do",
127-
plugin: nodeCloudDoPlugin
128-
}
104+
{
105+
name: 'aws',
106+
tag: 'aws',
107+
plugin: nodeCloudAwsPlugin,
108+
configPath: 'C:\\Users\\Rajitha\\opensource\\aws_cred.json',
109+
},
110+
{
111+
name: 'google',
112+
tag: 'google',
113+
plugin: nodeCloudGcpPlugin,
114+
configPath: {
115+
projectId: 'astral-hold-276807',
116+
keyFilename: 'C:\\Users\\Rajitha\\opensource\\gcp_cred.json',
117+
},
118+
},
119+
{
120+
name: 'azure',
121+
tag: 'azure',
122+
plugin: nodeCloudAzurePlugin,
123+
},
124+
{
125+
name: 'digitalocean',
126+
tag: 'do',
127+
plugin: nodeCloudDoPlugin,
128+
},
129129
];
130130
module.exports = providers;
131131
```
@@ -137,52 +137,52 @@ Congratulations! You just configured NodeCloud in your project. Let's start with
137137
The below code is an example of usage in AWS.
138138

139139
```js
140-
const nc = require("@nodecloud/common"); // NodeCloud common module
140+
const nc = require('@nodecloud/common'); // NodeCloud common module
141141
const optionsProvider = {
142-
overrideProviders: false
142+
overrideProviders: false,
143143
};
144144
const ncProviders = nc.getProviders(optionsProvider);
145145
const options = {
146-
apiVersion: "2017-11-01"
146+
apiVersion: '2017-11-01',
147147
};
148148

149149
const computeModule = ncProviders.aws.compute(options);
150150

151151
function launchInstance() {
152-
const instanceParams = {
153-
ImageId: "ami-07ebfd5b3428b6f4d", // Image of Ubuntu Server 18.04 LTS
154-
InstanceType: "t2.micro",
155-
KeyName: "nodeCloud", // key name of Key pair
156-
MinCount: 1,
157-
MaxCount: 1
158-
};
159-
160-
// create AWS EC2 instance
161-
computeModule
162-
.create(instanceParams)
163-
.then(res => {
164-
console.log(`All done ! ${res}`);
165-
})
166-
.catch(err => {
167-
console.log(`Oops something happened ${err}`);
168-
});
152+
const instanceParams = {
153+
ImageId: 'ami-07ebfd5b3428b6f4d', // Image of Ubuntu Server 18.04 LTS
154+
InstanceType: 't2.micro',
155+
KeyName: 'nodeCloud', // key name of Key pair
156+
MinCount: 1,
157+
MaxCount: 1,
158+
};
159+
160+
// create AWS EC2 instance
161+
computeModule
162+
.create(instanceParams)
163+
.then(res => {
164+
console.log(`All done ! ${res}`);
165+
})
166+
.catch(err => {
167+
console.log(`Oops something happened ${err}`);
168+
});
169169
}
170170

171171
function stopInstance() {
172-
const params = {
173-
InstanceIds: ["i-0928af5c626f85da9"],
174-
DryRun: false
175-
};
176-
177-
// stop AWS EC2 instance
178-
computeModule
179-
.stop(params)
180-
.then(res => {
181-
console.log(res);
182-
})
183-
.catch(err => {
184-
console.log(err);
185-
});
172+
const params = {
173+
InstanceIds: ['i-0928af5c626f85da9'],
174+
DryRun: false,
175+
};
176+
177+
// stop AWS EC2 instance
178+
computeModule
179+
.stop(params)
180+
.then(res => {
181+
console.log(res);
182+
})
183+
.catch(err => {
184+
console.log(err);
185+
});
186186
}
187187
```
188188

@@ -191,9 +191,9 @@ function stopInstance() {
191191
NodeCloud officially supports AWS, GCP, Azure, DigitalOcean and AliCloud. If you want to use a community-driven plugin override the providers' list as follows.
192192

193193
```js
194-
const nodeCloud = require("nodecloud");
194+
const nodeCloud = require('nodecloud');
195195
const options = {
196-
overrideProviders: true
196+
overrideProviders: true,
197197
};
198198
const ncProviders = nodeCloud.getProviders(options);
199199
```

generator/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The execution of the generator starts form the `main.ts` file, where the basic i
2323

2424
## Structure of `node-cloud.yml` file
2525

26-
- AWS
26+
- AWS
2727

2828
```
2929
AWS:
@@ -35,7 +35,7 @@ AWS:
3535
<img src="https://raw.githubusercontent.com/rajitha1998/waterme-Project/master/aws_diagram.png" />
3636
</p>
3737

38-
- Azure
38+
- Azure
3939

4040
```
4141
Azure:
@@ -47,7 +47,7 @@ Azure:
4747
<img src="https://raw.githubusercontent.com/rajitha1998/waterme-Project/master/azure_diagram.jpeg" />
4848
</p>
4949

50-
- Google Cloud (client based)
50+
- Google Cloud (client based)
5151

5252
```
5353
GCP:
@@ -67,7 +67,7 @@ GCP:
6767
<img src="https://raw.githubusercontent.com/rajitha1998/waterme-Project/master/gcp_client_based_diagram.jpeg" />
6868
</p>
6969

70-
- Google Cloud (class based)
70+
- Google Cloud (class based)
7171

7272
```
7373
GCP:
@@ -82,7 +82,7 @@ GCP:
8282

8383
For the class-based SDKs there is a minor change in the `node-cloud.yml` to record the main class of an SDK. For the above scenario, it’s the DNS class.
8484

85-
- Digital Ocean
85+
- Digital Ocean
8686

8787
```
8888
DO:
@@ -106,11 +106,11 @@ These functions are located in the generators of the each cloud providers. Each
106106

107107
This is the most important part of the code generator tool. Currently, there are four transformers. Two transformers for Google Cloud, and one each for AWS and Azure. All of the transformers runs three main transformations.
108108

109-
- `addFunctions`: In this transformation the basic structure of the code is created. Method Nodes are created to the number of functions in the `classData` object. If there are imports related to the class those statments are also added to the dummy **Abstract Syntax Tree**.
109+
- `addFunctions`: In this transformation the basic structure of the code is created. Method Nodes are created to the number of functions in the `classData` object. If there are imports related to the class those statments are also added to the dummy **Abstract Syntax Tree**.
110110

111-
- `addIdentifiers`: In this transformation all the Identifier nodes are updated. After this transformation the code is logically compelete. All the neccessary code parts are added and finalized such as parameter names, parameter types, client names, class name, package names, SDK function names etc.
111+
- `addIdentifiers`: In this transformation all the Identifier nodes are updated. After this transformation the code is logically compelete. All the neccessary code parts are added and finalized such as parameter names, parameter types, client names, class name, package names, SDK function names etc.
112112

113-
- `addComments`: This transformation aims to auto-generate the API documentation. All the comments are added to the structure required by `JSDoc`. The `@category` is used to categorize the generated classes depending on the cloud provider. This tag is from the `better-docs` template used with `JSDoc`.
113+
- `addComments`: This transformation aims to auto-generate the API documentation. All the comments are added to the structure required by `JSDoc`. The `@category` is used to categorize the generated classes depending on the cloud provider. This tag is from the `better-docs` template used with `JSDoc`.
114114

115115
## Understanding the directory structure of generator
116116

@@ -136,4 +136,4 @@ transformer which transforms the dummy class into an working Nodecloud class for
136136

137137
## Running the code generation tool
138138

139-
- To build classes run `tsc main && node main` or 'yarn run tool' if inside generator directory and `yarn run generator` if inside nodecloud directory.
139+
- To build classes run `tsc main && node main` or 'yarn run tool' if inside generator directory and `yarn run generator` if inside nodecloud directory.

0 commit comments

Comments
 (0)