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.
font-color-pipe
Advanced tools
[![Build Status](https://travis-ci.org/johnfedoruk/font-color-pipe.svg?branch=master)](https://travis-ci.org/johnfedoruk/font-color-pipe)
This package will not work with earlier versions of Angular!
This project contains an Angular 5 pipe that can be used for calculating the best font to display over an arbitrary background. The pipe, FontColorPipe, is exported from the FontColorModule.
npm install --save font-color-pipe
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FontColorModule } from 'font-color-pipe';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FontColorModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
./src/app/app/module.ts
import { Component, OnInit, ElementRef } from '@angular/core';
const WHITE: string = "#FFFFFF";
const BLACK: string = "#000000";
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
public _bg: string = WHITE;
constructor(private ref:ElementRef) {}
public ngOnInit(): void {
setInterval(
() =>
this.bg = this.bg === BLACK ? WHITE : BLACK,
1000
);
}
public set bg(bg: string) {
this._bg = bg;
this.ref.nativeElement.style.backgroundColor = this.bg;
}
public get bg(): string {
return this._bg;
}
}
src/app/app.component.ts
<h1 id="font" [ngStyle]="{'color':bg | fontColor}">Hello</h1>
src/app/app.component.html
FAQs
[![Build Status](https://travis-ci.org/johnfedoruk/font-color-pipe.svg?branch=master)](https://travis-ci.org/johnfedoruk/font-color-pipe)
The npm package font-color-pipe receives a total of 0 weekly downloads. As such, font-color-pipe popularity was classified as not popular.
We found that font-color-pipe 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.