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

bluefeather

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bluefeather - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

dist/delay.js

11

dist/index.js

@@ -6,4 +6,8 @@ 'use strict';

});
exports.promisify = undefined;
exports.promisify = exports.delay = undefined;
var _delay = require('./delay');
var _delay2 = _interopRequireDefault(_delay);
var _promisify = require('./promisify');

@@ -15,2 +19,5 @@

exports.promisify = _promisify2.default; // @flow
// @flow
exports.delay = _delay2.default;
exports.promisify = _promisify2.default;

@@ -16,5 +16,9 @@ 'use strict';

|};*/
/*:: type PromisifyType = (nodeFunction: Function, options?: PromisifyOptionsType) => Function;*/
/**
* Creates a function that when executed returns a promise whose fait depends
* on the callback provided as the last parameter to the wrapped function.
*/
/*:: type PromisifyType = (nodeFunction: Function, options?: PromisifyOptionsType) => Function;*/
const promisify /*: PromisifyType*/ = function promisify(nodeFunction) {

@@ -21,0 +25,0 @@ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

5

package.json

@@ -21,2 +21,3 @@ {

"babel-plugin-transform-flow-comments": "^6.17.0",
"babel-plugin-transform-function-bind": "^6.8.0",
"babel-plugin-transform-object-rest-spread": "^6.16.0",

@@ -70,3 +71,3 @@ "babel-preset-es2015-node4": "^2.1.0",

},
"version": "1.0.1"
}
"version": "1.1.0"
}

@@ -8,19 +8,37 @@ # Bluefeather

## API
WIP
### promisify
Bluefeather is a collection of utilities used to abstract common tasks when working with Promises.
Bluefeather does not extend the native Promise prototype. Bluefeather uses the native Promise implentation and leverages the [This-Binding Syntax](https://github.com/tc39/proposal-bind-operator) ECMAScript proposal to implement all of the [Bluebird API](bluebirdjs.com/docs/api-reference.html).
Using Bluefeather requires to transpile code using [`babel-plugin-transform-function-bind`](https://babeljs.io/docs/plugins/transform-function-bind/) Babel plugin.
## Bind operator
Bluefeather leverages the bind-operator proposal
```js
import {
promisify
mapSeries
} from 'bluefeather';
promisify(nodeFunction, options)
const names = [
'foo',
'bar',
'baz'
];
Promise
::mapSeries((value, indexValue) => {
return value + '_';
})
.then((values) => {
values;
// [
// 'foo_',
// 'bar_',
// 'baz_'
// ]
})
```
#### Options
|Name|Default|Description|
|---|---|---|
|`context`|`null`|`nodeFunction` is called as a method on the `context`.|
|`multipleArguments`|`false`|Makes the resulting promise fulfill with an array of the callback's success value(s).|
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