Capitalize (^6)

The ^6 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 ^6 immediately before the character you want to capitalize. Only the single character after ^6 is affected:

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

Compiles to:

const name = "Hello";

Multiple Capitalizations

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

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

Compiles to:

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

Class Names

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

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

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

Compiles to:

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

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

Methods & Properties

camelCase method names use ^6 at each uppercase boundary:

const obj ^- ^[
  get^6name^8^9 ^[
    return this.name;
  ^],
  set^6value^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 ^6:

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

Compiles to:

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

Inside Strings

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

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

Compiles to:

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

Disable in Strings

If you want ^6 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, ^6 inside strings is output literally:

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

Compiles to:

console.log("^6hello");

Uppercase Warnings in Strings

When both warnuppercase and capitalizeinstrings are true (default), the compiler also warns about uppercase letters found inside string literals. Since ^6 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 ^6h instead.
⚠ src/main.nsjs:1:24 - Uppercase letter 'W' found in string. Use ^6w instead.

Rewrite using ^6:

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

In Comments

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

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

Compiles to:

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

Related Configuration

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

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