1.0.3 • Published 7 years ago

asde v1.0.3

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

SYNOPSIS

A low level module for destructuring asynchronous values.

MOTIVATION

async helps solve promise hell and provides a sync-like way to receive values, but doesn't include a similar way to receive errors. asde is a simple, low level promise wrapper that returns both error and values as an array to which destructuring assignment can identify the values.

USAGE

const asde = require('asde')
const fs = require('fs')

const stat = asde(fs.stat)

async function main () {
  const [errStat, value] = await stat('./file')

  if (errStat) {
    return console.error(errStat)
  }

  console.log(value)
}

main()

INSTALL

npm install asde
1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago