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

@web2paper/modeling-svelte-pagedjs

v0.0.2

Published

Svelte wrapper for Paged.js integration in Web2Paper document models.

Readme

This Svelte library wraps the magnificent Paged.js library in a <PagedJS> component for usage in your Svelte-based Web2Paper models. If your document has more than a single page or very simple layout rules then you most likely need this.

⚠️ Web2Paper and its ecosystem are under construction. Expect breaking change to API and bugs.

Usage

Simply wrap the root of your document model's template within <PagedJS>:

<script lang="ts">
    import {DEFAULT_PAGEDJS_PROPS, PagedJS, type PagedjsProps} from '@web2paper/modeling-svelte-pagedjs';
    
    // Sane default options
    const options: PagedjsProps = DEFAULT_PAGEDJS_PROPS
</script>

<style>
    /* See the documentation of Paged.js (https://pagedjs.org/documentation/5-web-design-for-print/) */
    @page {
        margin: 10mm 20mm 30mm 40mm;

        @bottom-right {
            content: "I am a page number.";
        }
    }
</style>

<PagedJS {...options}>
    <!--  Your Web2Paper document template -->
    <main style="display: flex; flex-direction: column;">
        <h1>Hello world</h1>
        <h2>Chapter 1</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. A amet at dolore dolorem eos error id itaque magnam
            modi neque quia quis ratione reiciendis rem sed tempora totam, veritatis, voluptate!</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Assumenda aut autem cum dolor, dolores enim esse
            ex, exercitationem illo maxime perferendis quasi quibusdam quos sunt temporibus. Ex facere id quas?</p>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad consectetur dicta, ea facilis fugit harum hic
            illo minima modi necessitatibus nihil nisi omnis pariatur placeat praesentium quis quod recusandae
            voluptatibus?</p>
        <h2>Chapter 2</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci, aliquam autem, cum cumque delectus error
            eveniet, fugiat harum iure magnam minima neque obcaecati odio quas reprehenderit repudiandae sequi soluta
            voluptatem.</p>
    </main>
</PagedJS>

This component automatically import the previewing Previewer stylesheet in order to allow you to develop your model in the browser while previewing its printed appearance.

It seems like Vite live-reload may not work perfectly with PagedJS, you may need to reload manually the page to avoid some weird artifacts.

Acknowledgments

Paged.js has been a life savior for the Web2Paper project as it helps to bridge the gap between browsers and printed media for multi-pages documents. Huge thanks to all the people who worked and keep working on that project.

The code in this library is an adapted version of svelte-pagedjs. Thanks to @codebygio, its author, who did the hard integration work here.