const http = require('http');
const server = http.createServer((request, response) => {
let size = 0;
let n = 0;
request.on('error', (err) => {
}).on('data', (chunk) => {
size += chunk.length;
n++;
console.log('chunk', n, size);
}).on('end', () => {
console.log('end', size);
response.statusCode = 200;
response.setHeader('Content-Type', 'text/plain');
response.end('done\n');
});
});
server.listen(4000);
$ truncate --size 1000000 data
$ curl localhost:4000 --data-binary @data
chunk 1 32768
chunk 2 98304
chunk 3 163840
chunk 4 229376
chunk 5 294912
chunk 6 360448
chunk 7 425984
chunk 8 491520
chunk 9 557056
chunk 10 622592
chunk 11 688128
chunk 12 753664
chunk 13 819200
chunk 14 884736
chunk 15 950272
chunk 16 1000000
end 1000000
let obj = {
x: 10,
y: 'hello',
[Symbol('new')]: 'world'
};
const s = Symbol('new');
let obj = {
x: 10,
y: 'hello',
[s]: 'world'
};
console.log(obj[s]);
...
city: data[0].address?.city,
...
dd
выводит отчёт не в stdout, а в stderr. Так что нужно сначала перенаправить stderr в stdout, а потом передавать его в tee
:# башизм
dd if=/dev/zero of=/tmp/zerofile bs=100M count=5 |& tee ku.log &
# должно работать везде
dd if=/dev/zero of=/tmp/zerofile bs=100M count=5 2>&1 | tee ku.log &
JavaScript is an important part of the web platform because it provides many features that turn the web into a powerful application platform. Making your JavaScript-powered web applications discoverable via Google Search can help you find new users and re-engage existing users as they search for the content your web app provides. While Google Search runs JavaScript with an evergreen version of Chromium, there are a few things that you can optimize.