B
B
Bekkazy2018-09-06 07:25:28
Node.js
Bekkazy, 2018-09-06 07:25:28

How to measure page size in KB in Node JS?

The task is to measure the page size in KB for any page entered.
Are there modules for Node js for this task?
All search engines respond to requests with something like: "How to reduce the size of the site", etc.
I need to measure the size of any entered page

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Epifanov, 2018-09-06
@kacheleff

try the node-curl package

P
PloAl, 2018-09-06
@PloAl

It is not clear what the "introduced" page is.
The response or request objects have connection or socket properties, and the object accessed by those properties has bytesRead and bytesWritten properties.
You can use these properties to find out the exact number of bytes sent or received.

D
Dark_Scorpion, 2018-09-28
@Dark_Scorpion

I use just the developer console (F12) of the browser, tab "network". There, when loading the page, all requests and the size of the received data (compressed and not compressed) are shown.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question