1.3.3 • Published 5 years ago

@aedart/js-meta v1.3.3

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
5 years ago

Js Meta

Keeps track of various kinds of meta data about a class or a method, without manipulating the target.

Behind the scene, a WeakMap is used to store the information.

Contents

How to install

npm install @aedart/js-meta

Quick start

import Meta from '@aedart/js-meta';

class MyClass {
    // ... body not shown ..//
}

// Add arbitrary data about MyClass
Meta.addClass(MyClass, {
    name: 'MyClass',
    description: 'Yarr, swashbuckling strength!',
    maxLifetime: 23
});

// Obtain arbitrary data about MyClass
let metaData = Meta.get(MyClass); // Returns "@aedart/js-meta/src/Meta/ClassData" object

console.log(metaData.data);
// Outputs:
//  {
//        name: 'MyClass',
//        description: 'Yarr, swashbuckling strength!',
//        maxLifetime: 23
//   }

Please review internal documentation (@aedart/js-meta/src/Meta.js) for additional API information.

License

BSD-3-Clause, Read the LICENSE file included in this package

1.3.3

5 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.9.5

8 years ago

0.9.0

8 years ago