# CommandNodeHelper

`com.jsmacrosce.jsmacros.client.api.helper.CommandNodeHelper`

**Since:** 1.6.5

Holds server- and client-side command nodes returned by unregistration for re-registration.  
 Either node may be `null` when that dispatcher had no matching command.  
 ```js
const manager = Chat.getCommandManager();  

// take a command out, which gives back the node it was built from
const node = manager.unregisterCommand("hello");  
if (node !== null) {
  // Either dispatcher may have had no matching command.  
  if (node.getRaw() !== null) {
    Chat.log("was a server command");  
  }
  if (node.fabric !== null) {
    Chat.log("was also a client side command");  
  }

  // put it straight back
  manager.reRegisterCommand(node);  
}
 ```

## Constructors

### new CommandNodeHelper {#com.jsmacrosce.jsmacros.client.api.helper.CommandNodeHelper_constructor-CommandNode-}

```js
new CommandNodeHelper(CommandNode<?> base)
```

Wraps a server-side command node without a client-side node.

**Parameters:**
- `base`: the server-side node, or `null`

### new CommandNodeHelper {#com.jsmacrosce.jsmacros.client.api.helper.CommandNodeHelper_constructor-CommandNode-CommandNode-}

```js
new CommandNodeHelper(CommandNode<?> base, CommandNode<?> fabric)
```

Wraps the server- and client-side command nodes; either may be `null`.

**Parameters:**
- `base`: the node taken out of the server's command dispatcher, or `null`
- `fabric`: the node taken out of the client-side command dispatcher, or `null`

## Fields

### fabric {#com.jsmacrosce.jsmacros.client.api.helper.CommandNodeHelper_fabric}

```js
fabric: CommandNode<?>
```

The node removed from the client-side command dispatcher, or `null` if none was removed.
