Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@gund/ng-annotations
Advanced tools
Extract metadata of Angular components, directives, service etc.
Extract metadata of Angular components, directives, service etc.
$ npm install --save @gund/ng-annotations
Import Annotations
class first:
import { Annotations } from 'ng-annotations';
Then get annotations for you component:
@Component({selector: 'some-component'})
class MyComponent {
constructor() {
const annotations = Annotations.getFor(MyComponent);
// annotations.selector here will be `some-component`
}
}
Annotations
class Annotations {
static getFor(type: Type<any>): AllDecorators;
static getForDirective(type: Type<any>): Directive;
static getForComponent(type: Type<any>): Component;
static getForPipe(type: Type<any>): Pipe;
}
See src/annotations.ts for full reference
Description: Class with static methods to get annotations from type.
getFor()
static getFor(type: Type<any>): AllDecorators;
Description: Get annotations for the type. It will return all annotations found. If you want more specific type use methods below.
getForDirective()
static getForDirective(type: Type<any>): Directive;
Description: Get annotations for directive. Calls getFor() but returns type specific for Directive.
getForComponent()
static getForComponent(type: Type<any>): Component;
Description: Get annotations for component. Calls getFor() but returns type specific for Component.
getForPipe()
static getForPipe(type: Type<any>): Pipe;
Description: Get annotations for pipe. Calls getFor() but returns type specific for Pipe.
To generate all *.js
, *.js.map
, *.d.ts
and *.metadata.json
files:
$ npm run build
To lint all *.ts
files:
$ npm run lint
To run unit tests:
$ npm test
MIT © Alex Malkevich
FAQs
Extract metadata of Angular components, directives, service etc.
We found that @gund/ng-annotations demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.