Consume a Package Function

Consume a package function to use in your projects.

const fn = require('linkapi-sdk/core/fn');

const result = await fn.executeFromPackages('yourFunction', 'param1', 'param2');

Get a package function file and store in a variable. Call the method when you want.

const fn = require('linkapi-sdk/core/fn');

const myFunc = await fn.getFromPackages('yourFunction');

const result1 = await myFunc('param1'); // first call

const result2 = await myFunc('param2'); // second call