New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

after-operation

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

after-operation

Promise that resolves on completing a Google Compute Cloud [tm] operation

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

after-operation

Greenkeeper badge

Build Status Coverage Status

Helper for converting Google Compute Engine [tm] operation event-emitters to Promises

Deprecation Notice

Oct. 2019: Since GCE operations support operation.promise() you should probably use that instead.

Installation

npm i after-operation -S

Initialization

const after = require('after-operation');

Usage

Promise to return a value after an operation completes:

// some @google-cloud/compute method returns an operation
after(operation, onSuccessValue)
.then( (v)=>(assert.equal(v, onSuccessValue)) )
.catch(logTheOperationErrors)

Promise to call a function after the operation completes:

after(operation, (meta)=>(meta) )
.then(doSomethingUseful)
.catch(logTheOperationErrors)

Note that the success function gets fed with the metadata emitted in the operation 'complete' event.

By using the identity function as the success function, the promise will resolve to that metadata.

Note: after-operation will remove all operation listeners on either operation complete or operation error.

npm: event-to-promise might be useful with other eventEmitters.

2017 Paul Brewer - Economic and Financial Technology Consulting LLC drpaulbrewer@eaftc.com

License

The MIT License

Trademarks

Google Compute Engine [tm] is a trademark of Google, Inc.

This software is not a product of Google, Inc.

Keywords

FAQs

Package last updated on 25 Oct 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