Lines Matching defs:const
3 const common = require('../common');
8 const fs = require('fs');
9 const { open, writeFile } = fs.promises;
10 const path = require('path');
11 const { Readable } = require('stream');
12 const tmpdir = require('../common/tmpdir');
13 const assert = require('assert');
14 const tmpDir = tmpdir.path;
19 const filePathForHandle = path.resolve(tmpDir, 'tmp-write-file2.txt');
20 const fileHandle = await open(filePathForHandle, 'w+');
22 const buffer = Buffer.from('Hello world'.repeat(100), 'utf8');
25 const readFileData = fs.readFileSync(filePathForHandle);
34 const filePathForHandle = path.resolve(tmpDir, 'dogs-running.txt');
35 const fileHandle = await open(filePathForHandle, 'w+');
37 const buffer = Buffer.from('dogs running'.repeat(512 * 1024), 'utf8');
38 const controller = new AbortController();
39 const { signal } = controller;
49 const dest = path.resolve(tmpDir, 'tmp.txt');
50 const otherDest = path.resolve(tmpDir, 'tmp-2.txt');
51 const stream = Readable.from(['a', 'b', 'c']);
52 const stream2 = Readable.from(['ümlaut', ' ', 'sechzig']);
53 const iterable = {
68 const bufferIterable = {
76 const asyncIterable = {
86 const fileHandle = await open(dest, 'w+');
89 const expected = 'abc';
90 const data = fs.readFileSync(dest, 'utf-8');
98 const controller = new AbortController();
99 const { signal } = controller;
101 const fileHandle = await open(otherDest, 'w+');
113 const fileHandle = await open(dest, 'w+');
116 const data = fs.readFileSync(dest, 'utf-8');
124 const fileHandle = await open(dest, 'w+');
140 const fileHandle = await open(dest, 'w+');
143 const expected = 'ümlaut sechzig';
144 const data = fs.readFileSync(dest, 'latin1');
152 const fileHandle = await open(dest, 'w+');
155 const data = fs.readFileSync(dest, 'utf-8');
163 const fileHandle = await open(dest, 'w+');
166 const data = fs.readFileSync(dest, 'utf-8');
174 const fileHandle = await open(dest, 'w+');