nodeannotations
Advanced tools
+1
-1
| { | ||
| "name": "nodeannotations", | ||
| "version": "1.0.1", | ||
| "version": "1.0.2", | ||
| "description": "Annotations Support for NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+54
-4
@@ -5,3 +5,3 @@ # NodeAnnotations | ||
| ## Table of Contents | ||
| # Table of Contents | ||
| * [Getting Started](#getting-started) | ||
@@ -13,7 +13,7 @@ * [How To](#how-to) | ||
| * [Parsing an Annotated File](#parsing-an-annotated-file) | ||
| * [Class : Annotation(objectOf)](#class--annotation) | ||
| * [Class : Annotation](#class--annotation) | ||
| * [Annotation.value](#annotationvalue) | ||
| * [Annotation.[param]](#annotationparam) | ||
| * [Annotation.objectOf](#annotationobjectof) | ||
| * [Class : AnnotatedElement(name, type, annotations)](#class--annotatedelement) | ||
| * [Class : AnnotatedElement](#class--annotatedelement) | ||
| * [AnnotatedElement.getName()](#annotatedelementgetname) | ||
@@ -31,3 +31,4 @@ * [AnnotatedElement.getType()](#annotatedelementgettype) | ||
| * Clone the example repository | ||
| `git clone git@github.com:anupam-git/nodeannotations-example.git` | ||
| SSH : `git clone git@github.com:anupam-git/nodeannotations-example.git` | ||
| HTTPS : `git clone https://github.com/anupam-git/nodeannotations-example.git` | ||
| * Install Dependencies | ||
@@ -127,2 +128,24 @@ `npm install` | ||
| // Loop through all elements (Class, Method, Variable) that are annotated | ||
| /* | ||
| OUTPUT : | ||
| test : Method | ||
| {"value":"","objectOf":"Simple"} | ||
| {"value":"/controller/endpoint/param","objectOf":"Request"} | ||
| {"value":null,"objectOf":"Path","dir":"/home/user1","param":"somevalue"} | ||
| Test : Class | ||
| {"value":"/controller1/endpoint1/param1","objectOf":"Request"} | ||
| a : Variable | ||
| {"value":"/controller2/endpoint2/param2","objectOf":"Request"} | ||
| b : Variable | ||
| {"value":null,"objectOf":"Path","dir":"/home/user2","param":"someothervalue"} | ||
| c : Variable | ||
| {"value":"/controller3/endpoint3/param3","objectOf":"Request"} | ||
| testFunction : Method | ||
| {"value":null,"objectOf":"Path","dir":"/home","param":"test123"} | ||
| */ | ||
| annotatedElements.forEach((annotatedElement) => { | ||
@@ -142,2 +165,18 @@ console.log("\t"+annotatedElement.getName()+" : "+annotatedElement.getType()); | ||
| // Loop through the elements which are annotated with @Request() | ||
| /* | ||
| OUTPUT : | ||
| test : Method | ||
| {"value":"","objectOf":"Simple"} | ||
| {"value":"/controller/endpoint/param","objectOf":"Request"} | ||
| {"value":null,"objectOf":"Path","dir":"/home/user1","param":"somevalue"} | ||
| Test : Class | ||
| {"value":"/controller1/endpoint1/param1","objectOf":"Request"} | ||
| a : Variable | ||
| {"value":"/controller2/endpoint2/param2","objectOf":"Request"} | ||
| c : Variable | ||
| {"value":"/controller3/endpoint3/param3","objectOf":"Request"} | ||
| */ | ||
| annotatedElements.filterBy("Request").forEach((annotatedElement) => { | ||
@@ -157,2 +196,13 @@ console.log("\t"+annotatedElement.getName()+" : "+annotatedElement.getType()); | ||
| // Loop through the elements which are annotated with @Path() | ||
| /* | ||
| OUTPUT : | ||
| test : Method | ||
| dir: /home/user1 | ||
| b : Variable | ||
| dir: /home/user2 | ||
| testFunction : Method | ||
| dir: /home | ||
| */ | ||
| annotatedElements.filterBy("Path").forEach((annotatedElement) => { | ||
@@ -159,0 +209,0 @@ console.log("\t"+annotatedElement.getName()+" : "+annotatedElement.getType()); |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
20091
9.3%358
16.23%