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

bluebird-extra

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bluebird-extra

Extra methods for bluebird promises library

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
65
increased by10.17%
Maintainers
1
Weekly downloads
 
Created
Source

bluebird-extra

Extra methods for bluebird promises library

Current status

Build Status Dependency Status

API is mostly stable. Tests cover most scenarios but not very battle-tested in production as yet.

Suggestions on additional methods to add or ways to improve the existing methods are very welcome.

Usage

Loading module

To load module:

var Promise = require('bluebird-extra');

Or, to use another version of bluebird as the base for augmentation (perhaps one which has already been augmented):

var Promise = require('bluebird-extra').use(require('some-bluebird-version'));

Additional methods:

mapSeries()

Like Promise.map() but run in series.

mapOwn()
Aliases: mapObject(), mapValues()

Maps an object like lodash.mapValues()

Promise.mapOwn({ a: 1, b: 2 }, function(value, key, object) {
	// do something to the value and return it
});
mapIn()

Same as mapOwn() but also iterates through properties inherited from prototype.

mapOwnSeries()
Aliases: mapObjectSeries(), mapValuesSeries()

Same as mapOwn() but run in series.

mapInSeries()

Same as mapIn() but run in series.

own()

Iterates through properties of an object, calling the iterator function on each. Returns the object unchanged.

Promise.in({ a: 1, b: 2 }, function(value, key, object) {
	// do something
});
ownSeries()
Alias: forOwn()

Same as own() but run in series.

in()

Same as own() but also iterates through properties inherited from prototype.

inSeries()
Alias: forIn()

Same as in() but run in series.

eachAny()

Runs iterator on each item in an array in series until the iterator returns a result that is not undefined. Iteration is stopped and this result is returned.

ifElse()

Tests the value passed in. If truthy, the if function is run, otherwise the else function is run.

Promise.ifElse(testExpression, function(value) {
	// this runs if testExpression is truthy
}, function(value) {
	// this runs if testExpression is not truthy
});

Tests

Use npm test to run the tests.

Changelog

See changelog.md

Issues

If you discover a bug, please raise an issue on Github. https://github.com/overlookmotel/bluebird-extra/issues

FAQs

Package last updated on 16 Nov 2014

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