Socket
Socket
Sign inDemoInstall

blocking

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blocking

Pseudo-Blocking Async Javascript Functions


Version published
Weekly downloads
8
increased by700%
Maintainers
1
Weekly downloads
 
Created
Source

Blocking.js

Pseudo-Blocking Async Javascript Functions

  • Part of the Radioactive Framework
  • Notifying.js compatible

Installation via NPM

npm install blocking

Quickstart

blocking = require 'blocking'

# an async function
get_name_async = ( id, cb ) -> ...

# trasnsform to a blocking/sync function
get_name = blocking get_name_async

# do something using the sync function
f1 = ->
  # notice that we can call toUpperCase on the value
  # because this function now returns sychronously
  get_name( 8 ).toUpperCase()

# to execute the above function we need to unblock it
f1 = blocking.unblock f1

# and the function is async again
f1 (err, res) -> console.log err, res

FAQs

Package last updated on 09 Aug 2013

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