1.0.0 • Published 1 year ago

@ragarwal06/cf-operations v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

@ragarwal06/cf-operations - SAP BTP SSH & Enviorment Generator Wrapper for NodeJS (with Typescipt Support)

Table of contents

Install

Install from npm:

npm install @ragarwal06/cf-operations

or clone from the GitHub repository to run tests and examples locally:

git clone https://github.com/ragarwal06/cf-operations.git
cd cf-operations
npm install

Getting started

Loading Environment from SAP BTP

This is a very simple example showing how to use this module in Javascript:

const operations = require("@ragarwal06/cf-operations");
operations
  .generateDotEnv({
    appName: "appName",
    isBGDeployment: true,
  })
  .then((e) => {
    console.log("env loaded");
  })
  .catch((e) => console.log(e));

This is a very simple example showing how to use this module in Typescript:

import { generateDotEnv } from "@ragarwal06/cf-operations";

generateDotEnv({
  appName: "appName",
  isBGDeployment: true,
})
  .then((e) => {
    console.log("env loaded");
  })
  .catch((e) => console.log(e));

SSH Tunneling from SAP BTP to Local

This is a very simple example showing how to use this module in Javascript:

const operations = require("@ragarwal06/cf-operations");

operations
  .startTunneling({
    appName: "appName",
    isBGDeployment: true,
    outPort: 9094,
    serviceName: "serviceName",
    urlGenerator: (credentials) => {
      // make sure to generate & return the ssh format in
      // {url}:{port}
    },
  })
  .then((e) => {
    console.log("hi");
  });

This is a very simple example showing how to use this module in Typescript:

import { startTunneling } from "@ragarwal06/cf-operations";

startTunneling({
  appName: "appName",
  isBGDeployment: true,
  outPort: 9094,
  serviceName: "serviceName",
  urlGenerator: (creds) => {
    // make sure to generate & return the ssh format in
    // {url}:{port}
  },
}).then((e) => {
  console.log("hi");
});

Currently kafka & postgresql-db url generator is already available. So you can skip sending urlGenerator function

Contact

If you face any issue please write to owner or create a GitHub issue

For feature request please request here