@condor-labs/ceb-compliance-utils

1.7.1 • Public • Published

CEB Compliance Utils

Utility Library from CEB Compliance @condor-labs

In order to make things modular, we developed this utility library to be used in @condor-labs

How to use it

To use the library you just need to follow the following steps Install the library with npm

npm install @condor-labs/ceb-compliance-utils

IMPORTANT: Before using any dataCollector method, you must call the start function ONCE at the begining of your application so that the dataCollector connects properly to mongoDB

await dataCollector.start();

Example Code

const { dataCollector, utils } = require("../../library/index");

async function init() {
  try {
    /* dataCollector tool */
    console.log("Starting Data Collector Module...");

    //Make sure this method is called before using any method
    await dataCollector.start();

    console.log("Fetching profession using dataCollector...");
    const response = await dataCollector.getSettingsByProfession(159);
    console.log(response.nameProfession);

    /* utils tool */
    const params = {
      ownerId: 123,
      trigger: "UNIT_TEST",
    };
    const jobIdCompound = utils.generateJobId(params);
    console.log(response.nameProfession);
  } catch (error) {
    console.error(error);
  }
}

init();

How to run examples

- Go to the example folder
- Create a .env file and set the values
- Run script `node utils/index.js`, `node dataCollector/index.js`, so on...

Contributors

The original author and current lead maintainer of this module is the @condor-labs development team.

More about Condorlabs Here.

License

MIT

/@condor-labs/ceb-compliance-utils/

    Package Sidebar

    Install

    npm i @condor-labs/ceb-compliance-utils

    Weekly Downloads

    481

    Version

    1.7.1

    License

    MIT

    Unpacked Size

    209 kB

    Total Files

    104

    Last publish

    Collaborators

    • daniel.castillo
    • kevin.pedroza_condorlabs.io
    • federico-garcia
    • jorgesanes
    • hjimenez-condorlabs
    • awilches
    • jorgelozano95