1.0.8 • Published 12 months ago

@robocontest/io v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

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();
});
1.0.8

12 months ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago