Socket
Socket
Sign inDemoInstall

asde

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    asde

asynchronous destructuring


Version published
Maintainers
1
Install size
1.80 kB
Created

Readme

Source

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

FAQs

Last updated on 19 Jun 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc