package
Compile class and object decorators to ES5
npm install babel-plugin-transform-decoratorsGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Compile class and object decorators to ES5
(examples are from proposal)
@annotation
class MyClass { }
function annotation(target) {
target.annotated = true;
}@isTestable(true)
class MyClass { }
function isTestable(value) {
return function decorator(target) {
target.isTestable = value;
}
}class C {
@enumerable(false)
method() { }
}
function enumerable(value) {
return function (target, key, descriptor) {
descriptor.enumerable = value;
return descriptor;
}
}npm install --save-dev babel-plugin-transform-decorators.babelrc (Recommended).babelrc
{
"plugins": ["transform-decorators"]
}babel --plugins transform-decorators script.jsrequire("babel-core").transform("code", {
plugins: ["transform-decorators"]
});Latest published Apr 7, 2017
next
loganfsmyth
loganfsmyth@gmail.com
Estimated unpacked size across 19 packages.
3.0 MB
Includes dependencies.
5 direct dependencies.
^6.24.1
6.26.0
^6.22.0
6.26.0
^6.24.1
6.26.0
^6.24.1
6.24.1
6.13.0