Visit GNU ELPA's website, you can see the package's size, e.g., https://elpa.gnu.org/packages/ace-window.html says
ace-window-0.9.0.el, 2015-Jun-05, 18.7 KiB
Visit MELPA's website, you can get package's download URL, e.g., https://melpa.org/#/dash (notes that the website is a SPA, aka, Single Page Application, if you visit it for the first time, it needs download several MB json files), then you can get the size via the
Content-Length header, e.g.,
~ $ curl -I https://melpa.org/packages/dash-20200803.1520.tar
HTTP/1.1 200 OK
Date: Thu, 03 Sep 2020 12:27:39 GMT
Last-Modified: Thu, 03 Sep 2020 09:41:27 GMT
Would there be a way to do so from the list-packages interface?
You can also use the
Content-Length header. Be aware that it does not work for installed packages.
(defun your-package-menu-show-package-size ()
(let* ((pkg-desc (tabulated-list-get-id))
(url (concat (package-archive-base pkg-desc)
(with-current-buffer (let ((url-request-method "HEAD"))
(let ((case-fold-search t))
(unless (re-search-forward (rx bol "Content-Length: " (group (1+ num)) eol))
(error "No Content-Length header")))
(message "%s bytes" (match-string 1))
Most Emacs packages are small, just several hundreds or thousands line of code.