Create and use JavaScript modules in applications in the ServiceNow IDE
Optimize your codebase by defining reusable code blocks with JavaScript modules in the ServiceNow IDE.
Before you begin
Create, convert, or clone an application and add it to your workspace. For more information, see Adding applications in ServiceNow IDE.
Note:
To use TypeScript in modules, select TypeScript as the template type when creating an application.
Role required: admin
About this task
To learn about support for using JavaScript modules in scoped applications, including some limitations, see JavaScript modules and third-party libraries. For general information about the syntax used to create JavaScript modules, see the JavaScript modules page on the MDN Web Docs website.
Note:
With Now Assist for Code, you can use the Code autocomplete skill to generate code suggestions for module scripts. For more information, see Generate code with autocomplete.
Procedure
What to do next
To use third-party libraries in a JavaScript module, see Use third-party libraries in applications in the ServiceNow IDE.