All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.scalajs.nodejs.repl.REPL.scala Maven / Gradle / Ivy

The newest version!
package org.scalajs.nodejs
package repl

import org.scalajs.nodejs.events.EventEmitter
import org.scalajs.nodejs.net.Socket

import scala.scalajs.js
import scala.scalajs.js.|

/**
  * NodeJS REPL module
  * @author [email protected]
  */
@js.native
trait REPL extends NodeModule with EventEmitter {
  var REPL_MODE_SLOPPY: String = js.native
  var REPL_MODE_STRICT: String = js.native
  var REPL_MODE_MAGIC: String = js.native

  /**
    * @example repl.start([options])
    */
  def start(options: REPLOptions | NodeOptions): REPLServer = js.native

  /**
    * @example repl.start([options])
    */
  def start(prompt: String, socket: Socket): REPLServer = js.native

  /**
    * @example repl.start([options])
    */
  def start(prompt: String): REPLServer = js.native

  /**
    * @example repl.start([options])
    */
  def start(): REPLServer = js.native

}

/**
  * REPL Companion
  * @author [email protected]
  */
object REPL {

  /**
    * Convenience method for retrieving the repl module
    * @param require the implicit [[NodeRequire require function]]
    * @return the REPL instance
    */
  def apply()(implicit require: NodeRequire) = require[REPL]("repl")

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy