Skip to content

MethodsReplFn

reference
1 min readUpdated

Kind: Class

Source: packages/core/repl/native-functions/methods-repl-fn.ts

Part of: Core

MethodsReplFn is a native REPL function responsible for handling the methods command/action within the core REPL environment. Its action() method performs the command’s behavior, allowing the REPL to expose method-related information through the native-function system.

Extends: ReplFunction

Methods

MethodSignatureReturns
action`action(token: Typestring)`

Properties

PropertyType
fnDefinitionReplFnDefinition

Diagram

mermaid
graph LR
  User[REPL User] --> Command[methods command]
  Command --> MethodsReplFn[MethodsReplFn]
  MethodsReplFn --> Action[action()]
  Action --> Output[REPL Output]

Usage

ts
import { MethodsReplFn } from './packages/core/repl/native-functions/methods-repl-fn';

const methodsCommand = new MethodsReplFn();

// Execute the native REPL command behavior.
methodsCommand.action();

AI Coding Instructions

  • Keep command-specific behavior inside action() so it remains compatible with the REPL native-function dispatch flow.
  • Follow the conventions used by other classes in packages/core/repl/native-functions/ when adding output, validation, or context access.
  • Avoid placing interactive input parsing in this class unless other native functions use the same pattern; parsing is typically handled by the REPL command layer.
  • When changing displayed method information, ensure the output remains useful for interactive REPL users and consistent with related help or introspection commands.

Was this page helpful?

Download as PDF
MethodsReplFn — NestJS head-to-head