JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 16
  • Score
    100M100P100Q35138F
  • License ISC

A reader annotations from class write with ES6 syntax

Package Exports

  • class-annotations

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (class-annotations) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

class-annotations

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

/**
 * @Route( { name: "foo" , path: "/foo" , exactPath: true , methods=['GET'] } )
 * @Another = 35
 *
 * should be an excludes values
 *
 * @Another2: "hello"
 */
class Foo {

    constructor() {

        // ...
        // ...
    }

    // ...

} ;

app.js

const createClassAnnotations = require('class-annotations') ;

const ClassAnnotations = createClassAnnotations( __dirname ) ;

const annotations = new ClassAnnotations('./foo.js') ;

console.log( annotations ) ;

output log of annotations:

{
    classCount: 1 ,

    readers: {

        Foo: {
            data: {
                exludes: ['','should be an excludes values','']
                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"
        }
    }
}

you can persist the data type of all the natives type

you can read multiple class inner single file

  • npm install class-annotations --save
  • yarn add class-annotations

If you have detect an bug or anormal behavior with ClassAnnotaions please remote a issues on github