New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

nodeannotations

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodeannotations - npm Package Compare versions

Comparing version
1.0.1
to
1.0.2
+1
-1
package.json
{
"name": "nodeannotations",
"version": "1.0.1",
"version": "1.0.2",
"description": "Annotations Support for NodeJS",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -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());