jsdecorators

a few common js decorators bundled with the ones from core-decorators

Usage no npm install needed!

<script type="module">
  import jsdecorators from 'https://cdn.skypack.dev/jsdecorators';
</script>

README

Installation

npm install --save jsdecorators

Usage

import * as jsd from 'jsdecorators';

class Test {
  @jsd.restorecwd
  doSomeWork() { 
    
  }

  @jsd.deprecate('Use doSomeWork instead')
  doSomeOtherThing() { 
    
  }
}

Decorators

See core-decorators for more information about the bundled core decorators.

restorecwd

Wraps the target in a try/finally and restores process.cwd() to the value it had before the target was invoked.