Sync (mutex) class method decorator for ECMAScript.
npm install sync-decorator



Decorator to ensure that class method is not called by several callers simultaneously at the moment.
* Installation
* Usage
* Tests
* License
Install it via npm:
```
$ npm install --save sync-decorator
> This module requires NodeJS 6.9 or higher.
Example code:
`js
const test = new class Test {
@sync
method(attempt) {
console.log('executing', attempt);
return new Promise(resolve => setTimeout(
() => {
console.log('executed', attempt);
resolve();
},
1000
));
}
}
test.method(1);
test.method(2);
test.method(3);
`
Console output:
`text``
executing 1
executed 1
executing 2
executed 2
executing 3
executed 3
MIT