How to add npm module into servicenow?

Marqus
Kilo Contributor

Hello 

I just wnat to know that is it possible to add npm module into servicenow? Basically I have a requirement in which I need to implment https://openpgpjs.org/ so that we can perform pgp encryption.

This library contains many JS files so is there anyway in which I can implement its code into servicenow.

Please help me I got stuck at this.

5 REPLIES 5

Marqus
Kilo Contributor

Please help with the above query, any kind of help will be appreciated.

What do I need is, Encrypt and decrpt the attachments within servicenow. I donot want it to be done over midserver

Harsh Vardhan
Giga Patron

if you want to include external JS library in service now, you can either load in the script include so you use it in server side script. if you wanna load in UI Script then you will able to access it on client script. 

 

For Script include:

 

Create new Script include.

Open the js library url and copy the entire code and paste in your script include. 

 

now this way you can access the js function in service-now. 

 

 

 

 

 

 

But the thing is the library is written in Node.JS and serivcenow supports the core Java script.

Also there are so many .js files involved? do I need to create separate script includes for them?.

How can I import all of those .js files into servicenow by maintaining the same relationship.

Ravi Kiran M
Kilo Contributor

Im looking to import jsonwebtoken npm package to verify the incoming jwt token. Any luck on this ?