Skip to content

hybridables/then-got

Repository files navigation

Promisified simple-get.

code climate standard code style travis build status coverage status dependency status

Install

npm i then-got --save

Usage

For more use-cases see the tests

const thenGot = require('then-got')
const isStream = require('is-node-stream')

thenGot('http://www.tunnckocore.tk').then(stream => {
  console.log(isStream(stream)) // => true
}, console.error)

// or with simple-get's .concat method
// to get the content of the page
thenGot.concat('http://www.tunnckocore.tk').then(res => {
  const html = res[0]
  const stream = res[1]
  console.log(html)
}, console.error)

Related

  • letta: Let's move to promises! Drop-in replacement for co@4, but on steroids. Accepts sync, async and generator functions.
  • letta-value: Extends letta to accept and handles more than functions only. Handles all kind of results from letta. Basically, creating promise from everything - strings, arrays, objects, functions, generators, generator functions, promises, streams, child processe
  • redolent: Simple promisify everything (string, array, stream, boolean, sync/async function, etc) with sane defaults.
  • relike: Simple promisify a callback-style function with sane defaults. Support promisify-ing sync functions.
  • relike-all: Promisify all functions in an object, using relike.
  • relike-value: Create promise from sync, async, string, number, array and so on. Handle completion (results) and errors gracefully! Built on top of relike, used by redolent to build robust (hybrid) APIs.

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github