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 🙏

© 2025 – Pkg Stats / Ryan Hefner

agora-office

v0.0.9

Published

A typescript library to easily embed office documents in your webpage along with syncing enabled with Agora RTM

Downloads

14

Readme

AgoraOfficeViewer

A typescript library allowing anyone to quickly render office files in their page with all actions synced across all the users

Installation:

npm i agora-office

Usage

You can take a look at a sample app built using this library here

Documentation

AgoraOffice(backendUrl: string, channel: RtmChannel, iframe: HTMLIFrameElement)

Creates a new AgoraOffice Client Object.
backendUrl: It is the url pointing to your backend
channel: It is an RtmChannel object. You can see how to create that here
iframe: Reference to the iframe where you want the document to be rendered

setRole(role: Role)

Sets whether the office client should behave as a broacaster or receiver.
The receiver is always synced to the broadcaster. Example: In a word document the scroll position of the receiver would be in sync with the scroll position of the broadcaster
Important: There can be only 1 broadcaster

role: The role can be set as a broacaster or receiver.

  • Role.Broadcaster
  • Role.Receiver

loadDocument(fileUrl: URL): Promise

fileUrl: The URL of the document to be loaded into the iframe
Returns a promise that resolves when the document is done loading

syncDocument()

Starts the syncing of the documents.
If this method is not called for a particular receiver, the syncing will not work only for that receiver.
If this method is not called for the broadcaster, syncing will not work.

stopSync()

Stops the syncing.
Calling this method for a particular receiver, stops the sync only for that receiver
Calling this method for the broadcaster, stops the sync for everyone

renderFilePickerUi(): Promise

Renders a file picker UI inside the iframe. It uploads the file to the backend. It is a helper function in case the user does not want to build their own file picker mechanism. Uses Dropzone internally.
The promise resolves after the file is uploaded and returns a URL of the file which can then be passed into the loadDocument() function