Skip to content

Latest commit

 

History

History
12 lines (10 loc) · 336 Bytes

node-tricks.md

File metadata and controls

12 lines (10 loc) · 336 Bytes

deasync is a handy package for scripts where blocking is not important:

(ns some-script.core
  (:require
    ["deasync" :as deasync]
    ["request" :as request]))

(defn sync-request [url]
 ((deasync (fn [url cb] (.get request url (fn [err resp body] (cb err body)))))
  url))