New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

violin-annotations

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

violin-annotations

Annotation parser for Node.js

0.0.8
unpublished
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

violin-annotations

Annotation parser for Node.js

Installation

npm install violin-annotations

Will install the latest version of violin-annotations

Example

// ClassAnnotation.js

var util = require("util");

var Annotation = require("violin-annotations").Annotation,
    Target = require("violin-annotations").Target;

function ClassAnnotation(parameters) {
    Annotation.call(this, parameters);
}
util.inherits(ClassAnnotation, Annotation);

/**
 * Sample attribute
 */
ClassAnnotation.prototype.sample = "Hello world !";

ClassAnnotation.getTargets = function () {
    return [
        Target.CLASS_ANNOTATION
    ];
};

/**
 * @inheritDoc
 */
ClassAnnotation.getName =
    ClassAnnotation.prototype.getName = function () {
        return "ClassAnnotation";
    };

module.exports = ClassAnnotation;
// MyClass.js

/**
 * @ClassAnnotation(sample="Hello annotations")
 */
function MyClass() {

}

module.exports = MyClass;
var Parser = require("violin-annotations"),
    parser = new Parser();

parser.getRegistry().registerAnnotationFile("ClassAnnotation.js");

parser.parseFile("MyClass.js", function (annotations) {
    console.log(annotations);
});

Keywords

annotation

FAQs

Package last updated on 17 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts