promised-method

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

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
promised-method
1.0.06 years ago6 years agoMinified + gzip package size for promised-method in KB

Readme

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.
  1. Make your modifications in a branch, updating and writing new unit tests
as necessary in the `test` directory.
  1. Ensure that all tests pass with npm test

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

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

Code Style

This repository is configured with EditorConfigEditorConfig and ESLintESLint rules.