npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ekstra-bladet/display-ads

v0.3.1

Published

Giver mulighed for at håndtere annoncer i Ekstra Bladet familien

Readme

Display Ads (sveltekit)

Giver mulighed for at håndtere annoncer i Ekstra Bladet familien

Dette er afhængig af @ekstra-bladet/eb-cmp

Getting started

yarn add @ekstra-bladet/display-ads

Indsæt AdInit.svelte

<script lang="ts">
  import AdInit from '$lib/AdInit.svelte';
</script>

<AdInit />

AdInit forudsætter at der på page.data objektet findes et displayAds objekt med følgende interface

{
  adNamiEnabled?: boolean;
  anonIds?: {
    base: string;
    adform: string;
    google: string;
  };
  articleId?: string;
  adPlacements: IAdmanagerBanners[];
  device: DEVICE;
  highImpactEnabled?: boolean;
  keywords?: IKeywords;
  livewrappedKey: string;
  lwReplaceValues?: string[];
  pageContext: PAGETYPES;
  prebidEidsAllowed?: boolean;
  premium?: boolean;
  reloadOnBack?: boolean;
  segments?: string[];
  test?: boolean;
  topscroll?: boolean;
  topscrollWeekCount?: number;
  userType?: string;
}

adNamiEnabled (optionel)

For at denne skal kunne starte og køre skal strukturen fra static/adnami/adnm.html kopieres til sveltekit projektet. Det vil få adnami annoncer til at kunne køre på sitet.

anonIds

Annonymiserede ID'er til brug i annonce netværket. For at adform og google versionen af ID'erne skal have den rigtige værdi skal de igennem createAnonIds

import { createAnonIds } from '@ekstra-bladet/display-ads';

createAnonIds(eksisterendeId: string, receiver: 'adform' | 'google' | string);

articleId (optionel)

Artiklens id, såfremt man er på en artikel

adPlacements: IAdmanagerBanners[];

Annonce placeringer, struktureret som de er fra Admanager. Det anbefales at hente dem vha Admanager api'et

device: DEVICE;

desktop | tablet | smartphone

Bruges til at beslutte hvilke bannere der skal renderes

highImpactEnabled?: boolean;

Indsætter High Impacts script og muliggør mere eksklusive annonceformater gennem deres setup.

keywords?: [keywordKategori: string]: keyword(s);

Objekt der bruges til at sende kontekst til annoncenetværket, kunne eksempelvis være artikel tags.

livewrappedKey: string;

Konto ID hos livewrapped

lwReplaceValues?: [toBeReplaced, toBeReplacedWith];

Håndterer at replace dele af GAM navnet, så det kommer til at passe med hvad LiveWrapped forventer

pageContext: PAGETYPES;

ARTICLE | FRONTPAGE | SECTION

Bruges til at beslutte hvilke bannere der skal renderes

prebidEidsAllowed?: boolean;

Må der sendes bruger id'er til livewrapped/prebid annoncører - her sendes anonIds.adform

premium?: boolean;

Er den givne side betalt. Eksempelvis en plus artikel

reloadOnBack?: boolean;

Skulle man blive ramt af Back/Forward Cache, så refreshes annoncerne

segments?: string[];

Segmenter

test?: boolean;

Er vi på test miljø

topscroll?: boolean;

Er Topscroll annonceformatet tilladt.

topscrollWeekCount?: number;

Sættes som standard til 7 - hvilket betyder hver dag.

userType?: string;

anonymous | registered | customer

Sendes som key/value til annonce netværket