I have created a npm package to convert Devanagari to both IAST and HK
To convert text you need to install the following
https://nodejs.org/en/download/Install Windows or Mac package from the above post installation install Sanscript from the below website
https://www.npmjs.com/package/sanscriptFrom the Command Prompt install
npm install sanscript -g
Post installation from the Command Prompt
C:\> node
Type
Sanscript.t("धर्मक्षेत्रे कुरुक्षेत्रे","Devanagari","IAST");
Sanscript.t("धर्मक्षेत्रे कुरुक्षेत्रे","Devanagari","HK");