Lines Matching defs:const
3 const common = require('../common');
8 const fs = require('fs');
9 const { open } = fs.promises;
10 const path = require('path');
11 const fixtures = require('../common/fixtures');
12 const tmpdir = require('../common/tmpdir');
13 const assert = require('assert');
14 const tmpDir = tmpdir.path;
23 const filePath = path.resolve(tmpDir, file);
24 const buffer = Buffer.from(data, 'utf8');
26 const fd = fs.openSync(filePath, 'w+');
27 const fileHandle = await open(filePath, 'w+');
28 const streamFileHandle = await open(filePath, 'w+');
34 const readAsyncHandle =
41 const stream = fs.createReadStream(null, { fd: streamFileHandle });
43 for await (const chunk of stream)
55 const filePath = fixtures.path('x.txt');
56 const fileHandle = await open(filePath, 'r');
57 const pos = 0xffffffff + 1; // max-uint32 + 1
58 const readHandle =
65 const filePath = fixtures.path('x.txt');
66 const fileHandle = await open(filePath, 'r');
75 const opts = { useConf: true };
76 const filePath = fixtures.path('x.txt');
77 const fileHandle = await open(filePath, 'r');
78 const expectedSequence = ['x', 'y', 'z'];
81 const len = 1;
82 const pos = i % 3;
83 const buf = Buffer.alloc(len);
84 const { bytesRead } = await read(fileHandle, buf, 0, len, pos, opts);
91 const buf = Buffer.alloc(4);
92 const opts = { useConf: true };
93 const filePath = fixtures.path('x.txt');
94 const fileHandle = await open(filePath, 'r');
95 const { bytesRead } = await read(fileHandle, buf, 0, len, 0, opts);