🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@patternplate/box

Package Overview
Dependencies
Maintainers
5
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@patternplate/box

Wrap an async function to return a boxed result

3.2.5
latest
Source
npm
Version published
Weekly downloads
40
11.11%
Maintainers
5
Weekly downloads
 
Created
Source

Documentation and development interface for component libraries

@patternplate/box

  • Framework independent
  • Bring design docs to live with real components
  • Powerful search and meta data system

This is the contributor documentation for @patternplate/babel-preset For user docs see patternplate.github.io

About @patternplate/box

Wrap an async function to return a boxed result.

This is useful at callsites where errors might be expected and recoverable.

Install

npm install --save @patternplate/box

Usage

const {box} = require("@patternplate/box"); 

const fail = () => new Promise((_, reject) => reject(new Error("boop.")));
const boxed = box(fail);

boxed.then(box => {
  // box: {result: null, err: Error({message: "boop."})}
})

FAQs

Package last updated on 06 Jan 2019

Did you know?

Socket

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