promised-method

1.0.0 • Public • Published

promised-method

Build Status Coverage Status

Turns a function into one that always returns a Promise a la Blubird's Promise.method.

Usage

'use strict';

const promised = require('promised-method');

function Clazz() {}

Clazz.prototype.foo = promised(function(arg) {
	if (!arg) {
		throw new Error('need an arg!');
	}

	// ...
});

Testing

npm test

Contributing

  1. Fork the repository. Committing directly against this repository is highly discouraged.

  2. Make your modifications in a branch, updating and writing new unit tests as necessary in the test directory.

  3. Ensure that all tests pass with npm test

  4. rebase your changes against master. Do not merge.

  5. Submit a pull request to this repository. Wait for tests to run and someone to chime in.

Code Style

This repository is configured with EditorConfig and ESLint rules.

Dependents (1)

Package Sidebar

Install

npm i promised-method

Weekly Downloads

5,521

Version

1.0.0

License

Apache-2.0

Last publish

Collaborators

  • d2l-travis-deploy