0.0.1 • Published 8 years ago

esnext-decorators v0.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

esnext-decorators

Build Status

A collection of ES.next decorators.

Installing

esnext-decorators is available as an npm package.

Usage

Private Instance Members

import {encapsulated, internal} from 'esnext-decorators';

@encapsulated
class Foo {
  constructor() {
    this.privateVariable = 42;
    this.privateReadableVariable = 'foo';
    this.privateWritableVariable = 'bar';
  }

  get exposedReadableVariable() {
    return this.privateReadableVariable;
  }

  get exposedWritableVariable() {
    return this.privateWritableVariable;
  }
  set exposedWritableVariable(newValue) {
    this.privateWritableVariable = newValue;
  }

  publicMethod() {}

  @internal
  privateMethod() {}
}

Development

Getting Started

The application requires the following external dependencies:

  • Node.js

The rest of the dependencies are handled through:

npm install

Run tests with:

npm test