2.0.0 • Published 10 months ago
@redhat-cloud-services/javascript-clients-shared v2.0.0
@redhat-cloud-services/javascript-clients-shared / Exports
Shared Javascript utilities and functions for javascript-clients
This package contains some common configurations and functions needed for clients using the new javascript-clients generator.
Install
NPM
npm install --save @redhat-cloud-services/javascript-clients-sharedOr Yarn
yarn add @redhat-cloud-services/javascript-clients-sharedUsage
This client is using typescript and axios. Types are distributed with this package, so no need to define or install them separately.
To correctly bootstrap this API you should use this config (no need to define it multiple times, just one config and reimport it anywhere you want to use it).
// api.js
import APIFactory from '@redhat-cloud-services/javascript-clients-shared';
// BASE_PATH should be set in your constants file
const someApi = APIFactory(BASE_PATH, undefined, { createEndpoint, enableEndpoint });
export someApi;Building
Run nx build @redhat-cloud-services/javascript-clients-shared to build the library.
Running unit tests
Run nx test @redhat-cloud-services/javascript-clients-shared to execute the unit tests via Jest.