@everymundo/generate-microservice-name

1.1.2 • Public • Published

@everymundo/generate-microservice-name

It generates the microservice name by reading the data from the projects package.json

Install

npm install @everymundo/generate-microservice-name

Usage

The function getMicroserviceName will use your apps package.json file in order to either generate a valid microservice name under the Everymundo Naming Convention or retrieve the name contained in the config.customMicroserviceName

Common scenario

package.json

  "name": "my-app",
  "version": "1.2.3",

your-app.js

const { getMicroserviceName } = require('@everymundo/generate-microservice-name');

const myAppName = getMicroserviceName();

console.log(myAppName); // this will print my-app-v1

Namespaced scenario

In a different scenario, with a namespace for example

package.json

  "name": "@my-company/my-app-name",
  "version": "2.3.0",

your-app.js

const { getMicroserviceName } = require('@everymundo/generate-microservice-name');

const myAppName = getMicroserviceName();

console.log(myAppName); // this will print my-app-name-v2

Custom Microservice Name scenario

If, for some special reason, you need a different app name (not common), you can use this mechanism

package.json

  "name": "@my-company/my-app-name",
  "version": "2.3.0",
  "config": {
    "customMicroserviceName": "some-other-name-v2",
  }

your-app.js

const { getMicroserviceName } = require('@everymundo/generate-microservice-name');

const myAppName = getMicroserviceName();

console.log(myAppName); // this will print my-app-name-v2

Readme

Keywords

none

Package Sidebar

Install

npm i @everymundo/generate-microservice-name

Weekly Downloads

3

Version

1.1.2

License

MIT

Unpacked Size

12.9 kB

Total Files

6

Last publish

Collaborators

  • volodymyrpetrov
  • a11y-dev
  • jsalvadorpp
  • lindolo25
  • double2-us
  • ceciliagalarza
  • carla-villegas
  • eblez
  • mjremedios1985
  • mtmorell88
  • a11y_automation2
  • ramses83
  • raydel
  • alex-orga
  • estebanpablo89
  • yartiles
  • jonmorazav
  • everymundo-admin
  • ballester
  • danielsan
  • halain
  • avivero93
  • anahiem
  • herlin
  • karinfdez
  • erlin
  • front10devs
  • hdelcastillo
  • dcuevacem
  • rodneyem
  • ortega.dc98
  • pedroleon917
  • kaylingw
  • lazjramos
  • daniuska-em