use a reader of annotations for class write with ES6 syntax , with easy use.
- npm install class-annotations --save
- yarn add class-annotations
foo.js
class Foo {
constructor() {
}
} ;
app.js
const ClassAnnotation = require('class-annotations')( __dirname ) ;
const annotations = new ClassAnnotations('./foo.js') ;
console.log( annotations ) ;
output log of annotations
:
{
classCount: 1 ,
readers: {
Foo: {
data: {
Route: {
name: { valueBrut: "foo", value: "foo" } ,
path: { valueBrut: "/foo" , value: "/foo" } ,
exactPath: { valueBrut: "true" , value: true } ,
methods: { valueBrut: "['GET']" , value: [ 'GET' ] }
} ,
Another: {
valueBrut: "35" ,
value: 35
} ,
Another2: {
valueBrut: "hello" ,
value: "hello"
}
} ,
classname: "Foo"
}
}
}
ClassAnnotation
can persist the data type of all the natives type
- npm install class-annotations --save
- yarn add class-annotations