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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mindbowser_inc/ng-ineers-file-viewer

v1.1.2

Published

A versatile Angular library for viewing documents, images, and audio/video files directly within your Angular application. This library supports a variety of file types and offers customizable configurations.

Downloads

37

Readme

Angular Document, Image, and Audio/Video Viewer Library

A versatile Angular library for viewing documents, images, and audio/video files directly within your Angular application. This library supports a variety of file types and offers customizable configurations.

Features

  • Document Viewer: Supports public and private documents using Google, Office, PDF, and Mammoth viewers.
  • Image Viewer: Displays images with customizable buttons, zoom functionality, and keyboard navigation.
  • Audio/Video Viewer: Simple and efficient way to embed and play audio or video files.

Installation

Install the library via npm:

npm install @mindbowser_inc/ng-ineers-file-viewer --save

Getting Started

  1. Import Modules Add the necessary modules to your app module:
import { DocViewerModule, ImageViewerModule, AudioVideoViewer } from '@mindbowser_inc/ng-ineers-file-viewer';

@NgModule({
  imports: [
    DocViewerModule,
    ImageViewerModule,
    AudioVideoViewer
  ],
})
export class AppModule {}
  1. Usage Document Viewer To display a document:
<doc-viewer
  [url]="docUrl"
  viewer="google"
  style="width:100%;height:50vh;">
</doc-viewer>

Inputs:

url: The document URL. viewer: Choose from 'google' (default), 'office', 'mammoth', 'pdf', or 'url'. Image Viewer To display images:

<image-viewer [src]="imageUrls" [(index)]="currentIndex"></image-viewer>

Optional Configuration:

const config = {
  btnClass: 'default',
  zoomFactor: 0.1,
  allowFullscreen: true,
  allowKeyboardNavigation: true,
  btnIcons: {
    zoomIn: 'fa fa-plus',
    zoomOut: 'fa fa-minus',
    next: 'fa fa-arrow-right',
    prev: 'fa fa-arrow-left',
    fullscreen: 'fa fa-arrows-alt',
  }
};

Audio/Video Viewer To display audio:

<audio-video-viewer [url]="audioUrl" viewer="audio"></audio-video-viewer>

To display video:

<audio-video-viewer [url]="videoUrl" viewer="video"></audio-video-viewer>

File Type Support

Public Document Viewer

Google Viewer:

Supports .doc, .docx, .xls, .xlsx, .ppt, .pptx, .pdf.

Office Viewer:

Supports .doc, .docx, .xls, .xlsx, .ppt, .pptx.

Image Viewer

Supports all standard image formats including .jpg, .jpeg, .png, .gif. Audio/Video Viewer

Audio Video Viewer

Supports standard audio formats like .mp3, .wav and video formats like .mp4, .avi.

Blob Support with Mammoth

For viewing .docx files from blob using Mammoth, you can directly use the convertToHtml function integrated into the package.

For .docx files, install Mammoth:

npm install mammoth --save

Include mammoth.browser.min.js in angular.json:

"scripts": [
  "node_modules/mammoth/mammoth.browser.min.js"
]

Example Usage:

<doc-viewer
  viewer="mammoth"
  [url]="blobUrl"
  style="width:100%;height:50vh;">
</doc-viewer>

Custom Viewer Example For external document viewers:

<doc-viewer
  [viewerUrl]="'https://docs.google.com/gview?url=%URL%&embedded=true'"
  [url]="'https://example.com/sample.doc'"
  viewer="url"
  style="width:100%;height:50vh;">
</doc-viewer>

Contributions are welcome! Please open an issue or submit a pull request with your improvements or suggestions.