MCPcopy
hub / github.com/node-formidable/formidable / createMultipartBuffer

Function createMultipartBuffer

benchmark/index.js:35–46  ·  view source on GitHub ↗
(boundary, size)

Source from the content-addressed store, hash-verified

33console.log(`${mbPerSec} mb/sec`);
34
35function createMultipartBuffer(boundary, size) {
36 const head =
37 `--${boundary}\r\n` +
38 `content-disposition: form-data; name="field1"\r\n` +
39 `\r\n`;
40 const tail = `\r\n--${boundary}--\r\n`;
41 const buffer = Buffer.alloc(size);
42
43 buffer.write(head, 0, 'ascii');
44 buffer.write(tail, buffer.length - tail.length, 'ascii');
45 return buffer;
46}
47
48process.on('exit', () => {
49 assert.deepStrictEqual(calls, {

Callers 1

index.jsFile · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…