open-index/open-npm huggingface dataset:
npm package: @santanu2310/svelte-pdf-kit
Description: A minimal Svelte component for rendering multi-page PDFs, powered by PDF.js.
Latest version: 0.0.2

# @santanu2310/svelte-pdf-kit

A minimal Svelte component for rendering multi-page PDFs, powered by PDF.js.

## Installation

```sh
bun add @santanu2310/svelte-pdf-kit
```

or

```sh
npm i @santanu2310/svelte-pdf-kit
```

## Usage

PDF.js requires browser APIs, so ensure the component is rendered on the client side. In SvelteKit, you can disable SSR for the page or use a client-side check.

```svelte
<script lang="ts">
 import { PdfViewer } from '@santanu2310/svelte-pdf-kit';
 // Ensure the component is rendered on the client side
 export const ssr = false;
</script>

<div class="pdf-viewer">
 <PdfViewer url="./sample.pdf" />
</div>
```

## Contributing

### Setup and Running Instructions

1. **Clone the repository**

   ```sh
   git clone https://github.com/santanu2310/svelte-pdf-kit.git
   cd svelte-pdf-kit
   ```

2. **Install dependencies**

   ```sh
   bun install
   ```

3. **Start development server**

   ```sh
   bun run dev
   ```

   This will start the development server where you can see the showcase app in `src/routes`.

4. **Build the library**

   ```sh
   bun run build
   ```

5. **Lint and Format**

   ```sh
   bun run lint
   bun run format
   ```