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

metasvelte

v1.0.0

Published

Powerful, type-safe, and modular SEO meta management library for SvelteKit 5

Readme

MetaSvelte 🚀

Library SEO meta management yang powerful, type-safe, dan modular untuk SvelteKit 5.

npm version License: MIT

✨ Fitur

  • 🎯 Type-Safe - Full TypeScript support dengan type inference
  • 🧩 Modular - Composable helpers untuk berbagai use cases
  • 🔄 Dinamis - SEO config bisa disesuaikan per route
  • 🌐 Multi-Platform - Support Open Graph, Twitter Cards, Facebook, LinkedIn
  • 📊 JSON-LD - Built-in support untuk structured data
  • Svelte 5 Runes - Menggunakan Svelte 5 reactive system
  • 🎨 Presets - Pre-configured templates untuk use cases umum

📦 Instalasi

bun add metasvelte
# atau
npm install metasvelte
# atau
pnpm add metasvelte

🚀 Quick Start

1. Setup di Root Layout

<!-- src/routes/+layout.svelte -->
<script lang="ts">
	import { SeoHead, seoStore, createSeoConfig } from 'metasvelte';

	const defaultSeo = createSeoConfig({
		base: {
			title: 'My Awesome Site',
			description: 'Deskripsi website Anda',
			keywords: ['sveltekit', 'seo']
		},
		openGraph: {
			type: 'website',
			siteName: 'My Awesome Site'
		},
		twitter: {
			card: 'summary_large_image',
			site: '@yourhandle'
		}
	});

	seoStore.setDefault(defaultSeo);

	let { children } = $props();
</script>

<SeoHead />
{@render children()}

2. Override di Halaman Spesifik

<!-- src/routes/about/+page.svelte -->
<script lang="ts">
	import { SeoHead } from 'metasvelte';

	const aboutSeo = {
		base: {
			title: 'About Us - My Awesome Site',
			description: 'Tentang kami dan misi kami',
			canonical: 'https://mysite.com/about'
		},
		openGraph: {
			title: 'About Us',
			url: 'https://mysite.com/about',
			image: 'https://mysite.com/about-og.jpg'
		}
	};
</script>

<SeoHead config={aboutSeo} />

3. Dynamic SEO untuk Blog Post

<script lang="ts">
	import { SeoHead, createArticleSeo } from 'metasvelte';
	import type { PageData } from './$types';

	let { data }: { data: PageData } = $props();

	const seo = $derived(
		createArticleSeo({
			title: data.post.title,
			description: data.post.excerpt,
			url: `https://myblog.com/posts/${data.post.slug}`,
			image: data.post.coverImage,
			author: data.post.author,
			publishedTime: data.post.publishedAt,
			tags: data.post.tags
		})
	);
</script>

<SeoHead config={seo} />

📚 Dokumentasi Lengkap

Lihat DOCUMENTATION.md untuk dokumentasi lengkap.

🎯 Use Cases

Blog/Article

import { createArticleSeo } from 'metasvelte';

const seo = createArticleSeo({
	title: 'Article Title',
	description: 'Article description',
	url: 'https://site.com/article',
	image: 'https://site.com/image.jpg',
	author: 'John Doe',
	publishedTime: '2024-01-15T10:00:00Z'
});

E-commerce Product

import { createProductSeo } from 'metasvelte';

const seo = createProductSeo({
	name: 'Product Name',
	description: 'Product description',
	url: 'https://site.com/product',
	image: 'https://site.com/product.jpg',
	price: '99.99',
	currency: 'USD'
});

🔧 API Overview

Components

  • <SeoHead> - Komponen utama untuk render meta tags

Store

  • seoStore - Global state management untuk SEO config

Helpers

  • createSeoConfig() - Create SEO config dengan defaults
  • createArticleSeo() - Helper untuk artikel/blog
  • createProductSeo() - Helper untuk produk e-commerce
  • createOrganizationSeo() - Helper untuk organization
  • mergeSeoConfigs() - Merge multiple configs

🧪 Testing SEO

📝 License

MIT

🤝 Contributing

Contributions are welcome!

❓ FAQ

Kenapa ada komentar <!--1t153bb--> di HTML?

Ini adalah Svelte hydration markers dan tidak mempengaruhi SEO. Search engine crawler (Google, Facebook, Twitter) mengabaikan komentar HTML ini. Meta tags Anda tetap terbaca dengan sempurna.

Lihat HYDRATION_MARKERS.md untuk penjelasan lengkap.

Apakah meta tags duplikat?

Pastikan hanya render <SeoHead> di page, bukan di layout. Layout hanya untuk set default config:

<!-- +layout.svelte - HANYA set default -->
<script>
  import { seoStore, createSeoConfig } from 'metasvelte';
  seoStore.setDefault(createSeoConfig({ ... }));
</script>

<!-- +page.svelte - Render SeoHead -->
<script>
  import { SeoHead } from 'metasvelte';
</script>
<SeoHead config={{ ... }} />

🖥️ Server-Side Rendering (Optional)

Jika Anda ingin HTML yang 100% clean tanpa hydration markers, gunakan server-side rendering:

// +page.server.ts
import { renderSeoTags } from 'metasvelte/server';

export const load = async () => {
	const seoHtml = renderSeoTags({
		base: { title: 'My Page', description: '...' }
	});
	return { seoHtml };
};
<!-- +page.svelte -->
<svelte:head>
	{@html data.seoHtml}
</svelte:head>

Lihat /server-example untuk demo lengkap.