Capitalize Modifier (^3)

The ^3 modifier capitalizes the next character. Since NoShift.js is designed to avoid the Shift key, this is how you produce uppercase letters.

Basic Usage

Place ^3 immediately before the character you want to capitalize. Only the single character after ^3 is affected:

const name ^- ^2^3hello^2;
// ^3h → H, rest stays as-is

Compiles to:

const name = "Hello";

Multiple Capitalizations

To capitalize multiple characters (e.g., camelCase or PascalCase identifiers), repeat ^3 before each character:

const my^3var ^- ^2^3hello ^3world^2;
console.log^8my^3var^9;

Compiles to:

const myVar = "Hello World";
console.log(myVar);

Class Names

Class names in JavaScript are conventionally PascalCase. Use ^3 before each uppercase letter:

class ^3animal ^[
  constructor^8name^9 ^[
    this.name ^- name;
  ^]
^]

class ^3my^3app extends ^3animal ^[
  constructor^8^9 ^[
    super^8^2^3app^2^9;
  ^]
^]

Compiles to:

class Animal {
  constructor(name) {
    this.name = name;
  }
}

class MyApp extends Animal {
  constructor() {
    super("App");
  }
}

Methods & Properties

camelCase method names use ^3 at each uppercase boundary:

const obj ^- ^[
  get^3name^8^9 ^[
    return this.name;
  ^],
  set^3value^8v^9 ^[
    this.value ^- v;
  ^],
^];

Compiles to:

const obj = {
  getName() {
    return this.name;
  },
  setValue(v) {
    this.value = v;
  },
};

Constants (UPPER_SNAKE_CASE)

For ALL_CAPS constants, capitalize every letter with ^3:

const ^3m^3a^3x^3c^3o^3u^3n^3t ^- 1024;
console.log^8^3m^3a^3x^3c^3o^3u^3n^3t^9;

Compiles to:

const MAXCOUNT = 1024;
console.log(MAXCOUNT);

Inside Strings

By default, ^3 also works inside string literals (^2...^2, ^7...^7, ^@...^@). This means you can produce uppercase text in strings without Shift:

console.log^8^2^3hello, ^3world!^2^9;
console.log^8^7^3yes^7^9;
console.log^8^@^3template ^3string^@^9;

Compiles to:

console.log("Hello, World!");
console.log('Yes');
console.log(`Template String`);

Disable in Strings

If you want ^3 inside strings to be treated as a literal caret + character (not capitalized), set capitalizeinstrings to false in nsjsconfig.json:

{
  "compileroptions": {
    "capitalizeinstrings": false
  }
}

With this setting, ^3 inside strings is output literally:

console.log^8^2^3hello^2^9;

Compiles to:

console.log("^3hello");

Uppercase Warnings in Strings

When both warnuppercase and capitalizeinstrings are true (default), the compiler also warns about uppercase letters found inside string literals. Since ^3 is available in strings, writing uppercase directly is discouraged:

console.log^8^2Hello World^2^9;

Example warnings during compilation:

⚠ src/main.nsjs:1:18 - Uppercase letter 'H' found in string. Use ^3h instead.
⚠ src/main.nsjs:1:24 - Uppercase letter 'W' found in string. Use ^3w instead.

Rewrite using ^3:

console.log^8^2^3hello ^3world^2^9;

In Comments

^3 does not work inside comments. Comments are passed through as-is:

// ^3this is a comment, ^3 does not capitalize
/^: ^3block comment, also literal ^:/

Compiles to:

// ^3this is a comment, ^3 does not capitalize
/* ^3block comment, also literal */

Related Configuration

Two config options in nsjsconfig.json affect ^3 behavior:

Option Default Description
warnuppercase true When true (default), the compiler warns if you write uppercase letters directly in source code instead of using ^3.
capitalizeinstrings true When true (default), ^3 works inside string literals. Set to false to disable.