GithubHelp home page GithubHelp logo

now-globals's Introduction

@hrax/now-globals

Manually maintained global variables for different Service Now script scopes

Inspired by globals, this is just a JSON file that can be used in any environment.

Package is meant to add most common used Service Now globals to ESLint configuration for Service Now scripts.

Install

npm i @hrax/now-globals

Usage

const nowGlobals = require("@hrax/now-globals");

// Print global variables accessible in Service Now client scripts
console.log(nowGlobals.client);

Usage with ESLint

// eslint.config.js
const nowGlobals = require("@hrax/now-globals");

module.exports = [
  {
    languageOptions: {
      globals: {
        ...nowGlobals.scopes,
        ...nowGlobals.server
      }
    }
  }
];

Globals Sets

nowGlobals.scopes

Set of global variable scopes in out-of-box Service Now instances or out-of-box activated Service Now plugins.

nowGlobals.server

Service Now server globals used in Global or Scoped scripts.

nowGlobals.client

Most common used Service Now client globals used in client scripts. Should be used for scripts in, for example:

  • sys_script_client.script
  • sys_ui_action.client_script_v2
  • sys_ui_page.client_script
  • sys_ui_policy.script_false
  • sys_ui_policy.script_true

nowGlobals.widget

Global variables accessible in Service Now Widget server scripts.

nowGlobals.ng

Global variables used in Service Now Angular scripts. Should be used for scripts in, for example:

  • sp_angular_provider.script
  • sp_widget.client_script
  • sp_widget.link

nowGlobals.atf

Globals used in Service Now Test Step Configurations or Test Server Side Script step tests.

now-globals's People

Contributors

hrax avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.