@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

    Keywords

    none

    Install

    npm i @everymundo/generate-microservice-name

    DownloadsWeekly Downloads

    14

    Version

    1.1.2

    License

    MIT

    Unpacked Size

    12.9 kB

    Total Files

    6

    Last publish

    Collaborators

    • estebanpablo89
    • yartiles
    • jonmorazav
    • emdavidmoreno
    • everymundo-admin
    • ballester
    • danielsan
    • halain
    • avivero93
    • anahiem
    • neilgoldman
    • herlin
    • davidxl
    • karinfdez
    • ernestocarrasco
    • erlin
    • alexandprivate
    • front10devs
    • hdelcastillo
    • dcuevacem
    • rodneyem
    • raydel
    • ortega.dc98
    • pedroleon917
    • salvadorgonzalezgomez
    • kaylingw
    • joeaspiazuem
    • lazjramos
    • mounikaeverymundo
    • daniuska-em
    • cstansfld
    • vladimirpetrov
    • jsalvadorpp