max-buffer.js
This file
Path
test/fixtures/max-buffer.js
13 lines · 331 bytes · JavaScript
Last changed by
Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207
History of this fileTake it
Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880
lines 1–2why, one step back1#!/usr/bin/env node2import process from 'node:process';Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207
line 3why, one step back3import {writeSync} from 'node:fs';Require Node.js 12.20 and move to ESM (#478)Minh Nguyenbefore adoption7707880
line 4why, one step back4Add `result.stdio` and `error.stdio` (#676)ehmickybefore adoption62a5207
lines 5–13why, one step back5const index = Number(process.argv[2]);6const bytes = '.'.repeat(Number(process.argv[3] || 1e7));7if (index === 1) {8 process.stdout.write(bytes);9} else if (index === 2) {10 process.stderr.write(bytes);11} else {12 writeSync(index, bytes);13}