downit

An asynchronous donwload system.

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:25

Installation

nimble install downit
choosenim install downit
git clone https://github.com/Patitotective/downit

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
downit - - - - - - -

Source

Repository https://github.com/Patitotective/downit
Homepage https://github.com/Patitotective/downit
Registry Source nimble_official

README

DownIt

Asynchronous downloads and requests manager library for Nim.

nimble install downit

Usage

The Downloader object holds all the downloads data, initDownloader takes the root directory for all the downloads (or "" if none), the poll timeout (by default 1 ms), and optionally a proxy, an username and a password for the proxy (you can change the proxy always using setProxy or removeProxy).
After initializing it, downloading something it's just as easy as calling download, procedure that takes the url, path and an optional name, if not given the path will be the name. Setting a name is useful to identify a download and makes changing the path a lot easier.
You can also make a GET request using the request procedure, passing the url and optionally a name. After making a download/request you can use the running, succeed, finished and failed procedures to check wheter a download/request finished, is still in progress or failed.

var downloader = initDownloader("./docs") # We could add proxy = "http://127.0.0.1:8888"
downloader.download("https://nim-lang.org/docs/os.html", "os.html", "os")
downloader.request("https://nim-lang.org/docs/strformat.html", "strformat")

while true:
  downloader.update() # Poll events and check if downloads are complete

  if downloader.succeed("os") and downloader.succeed("strformat"):
    echo readFile(downloader.getPath("os").get())
    echo downloader.getBody("strformat").get()
    break

  elif downloader.getError("os").isSome: # You can also do downloader.getState("os").get() == DownloadError
    raise downloader.getError("os").get()

Remember to compile with -d:ssl.

Read more at the docs

About

  • GitHub: https://github.com/Patitotective/downit.
  • Discord: https://discord.gg/U23ZQMsvwc.

Contact me: - Discord: Patitotective#0127. - Twitter: @patitotective. - Email: cristobalriaga@gmail.com.