http = require 'http'
module.exports = class Request
get: (url, cb) ->
http.get url, (res) ->
body = ''
res.on 'data', (chunk) ->
body += chunk.toString()
res.on 'end', () ->
cb.apply res, [body]
http = require 'http'
module.exports = class Request
get: (url) ->
new Promise (resolve, reject)->
req = http.get url, (res) ->
body = ''
res.on 'data', (chunk) ->
body += chunk.toString()
res.on 'end', ->
resolve body
req.on 'error', reject
require(ваш_модуль).get(ваш_url)
.then (страница)->
.catch (ошибка)->