@robocontest/io
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

Nodejs IO package for Robocontest.uz

Usage:

let io = require('@robocontest/io');

const {input, output} = io(process.stdin, process.stdout);

input.start().then(async () => {
  let a = await input.readNumber();
  let b = await input.readNumber();

  output.write(a + b);
  output.close(); // close is mandatory if you want if streams correctly flushed to file
});
let io = require('@robocontest/io');

const {input, output} = io('input.txt', 'output.txt');

input.start().then(async () => {
  let a = await input.readNumber();
  let b = await input.readNumber();

  output.write(a + b)
  output.close();
});

Shorter import

const {input, output} = require('@robocontest/io')(process.stdin, process.stdout);

input.start().then(async () => {
  let a = await input.readNumber();
  let b = await input.readNumber();

  output.write(a + b);
  output.close();
});

All methods:

const {input, output} = require('@robocontest/io')(process.stdin, process.stdout);

input.start().then(async () => {
  let a = await input.read(); // a word
  let b = await input.readLine(); // a line
  let c = await input.readNumber(); // a number
  let d = await input.readNumberArray(c); // a number array
  let e = await input.readBigInt(); // a bigint

  output.close();
});

/@robocontest/io/

    Package Sidebar

    Install

    npm i @robocontest/io

    Weekly Downloads

    1

    Version

    1.0.8

    License

    MIT

    Unpacked Size

    15.5 kB

    Total Files

    20

    Last publish

    Collaborators

    • adizbek