Huge News!Announcing our $40M Series B led by Abstract Ventures.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
  • Socket score

Version published
Weekly downloads
5
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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc