wanted to use npm package in office js excel addin as custom function

22 Views Asked by At

I do not know if this is working already or not.

I am working on a project that needs to use a custom function in this function I need to use an npm package is that possible.

This is my code:

import numberToWords from "number-to-words";

export function TA(first1) {
console.log(first1);

// Convert the number to words
const words = numberToWords.toWords(first1);

return first1;
}

CustomFunctions.associate("TA", TA);

code in json file:
{

"functions": [
    {
        "description": "Add two numbers",
        "id": "TA",
        "name": "TA",
        "parameters": [
            {
                "name": "first1",
                "type": "any"
            }
        ]
       
    }
]
}

Wanted to work this npm package as a custom function in excel js addin. already created shared run time just want to know can I use npm package in custom function or not if yes this how?

0

There are 0 best solutions below