Socket
Socket
Sign inDemoInstall

console-mpds

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    console-mpds

Make easier the input / output in Javascript NodeJS console programs.


Version published
Maintainers
1
Created

Readme

Source

Console MPDS

This package has a class called Console to make easier to use the input/output in NodeJS console programs.

It offers several methods to output messages to the console and make text user input also in the console.

Usage

Create a new npm project:

npm init -y

Install this package:

npm install console-mpds

Require and instantiate the Console Class in your code:

const { Console } = require("console-mpds");
const console = new Console();

Use the object to input and output to the console:

const num = console.readNumber('dame un numero');
console.writeln(`Has escrito ${num}`);

Available Methods

The console objects has this methods in order to make the user input / output.

  • write(text): Send a text to the console.
  • writeln(text): Send a text to the console and do a new line.
  • readString(text): Ask for a string input and wait for the user response. This method returns the introduced text.
  • readNumber(text): Ask for a number input and wait for the user response. This method converts the input in its integer value and returns the introduced value as primitive type number.

Keywords

FAQs

Last updated on 26 Apr 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc