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

@kencas/livedoc

v0.0.2

Published

LiveDoc service loads documents over WS and gets updates as deltas

Downloads

2

Readme

Livedoc

Using LiveDoc Service

If the LiveDoc library was published to an NPM registry, then it will be consumed normally.

Below will be examples of consuming the library from a git repo. For more details on building the URL, see Git URLs as Dependencies.

Installing using the command line

npm install livedoc@git+https://git.server.url

Instlling using package.json

  "dependencies": {
    "livedoc": "git+https://git.server.url"
  }

Providing settings

The service must receive basic settings during instantiation. LiveDoc service expects settings to conform to LiveDocSettings interface.

For example, this could be placed in file \src\app\app.settings.ts:

import { LiveDocSettings } from '@livedoc';

export const APP_LIVEDOC_SETTINGS: LiveDocSettings = {

        /* Location of the configuration file. Must conform to interface LiveDocConfig declared in `./livdoc.interface` */
        configUrl: '/ldbckcfg',

        /* When all STOMP subscriptions are closed for a WS socket,
        the socket may be closed or kept open until all sockets are closed explicitely */
        keepWsOpen: false,

        /* This service can throttle emissions on all streams. */
        throttle: true,

        /* If throttling is enabled above, emission of a new value will be delayed for the period specified by this setting.
        If, during this pause (or a throttle period), any newer values are received,
        the last such value will be emitted when the throttle period ends.
        The latest value is always emitted with the maximum delay, specified by `throttleTime` */
        throttleTime: 300, // Milliseconds

        // Number of times to retry each STOMP subscription before quiting. Use any negative number for retrying infinitely
        retryCount: -1,

        // Delay, in milliseconds, for retrying
        retryDelay: 2000,

        // 'none', 'some' or 'all'
        logLevel: 'all',
};

Notice that only configUrl key is mandatory and represents a full or partial URL for the configuration file for LiveDoc servers. The other keys are optional.

Injecting Settings

To inject the settings (defined above) into the LiveDoc service, provide the LIVEDOC_SETTINGS Injection token.

For example, the following could be added to file \src\app\app.module.ts:

import { LIVEDOC_SETTINGS } from '@livedoc'; // Injection token to provide settings
import { APP_LIVEDOC_SETTINGS } from './app.settings'; // Actual LiveDoc settngs

@NgModule({
  // ...
  providers: [
    {
      provide: LIVEDOC_SETTINGS,
      useValue: APP_LIVEDOC_SETTINGS
    }
  ],
  // ...
})
export class AppModule { }

LiveDoc server configuration

LiveDoc Service needs to get a configuration for LiveDoc servers. This file should be accessible via web protocols. The URL of the configuration file was provided to LiveDoc service as the only mandatory key configUrl to the LiveDocSettings object.

The configuration file should conform to the LiveDocConfig interface.

Using in a Component

Here is a sample use of LiveDoc service inside a Component:

import { LiveDocService, StompHeaders, CallCenterStats } from 'livedoc';

export class StompTesterComponent {

  callCenterStats: CallCenterStats;

  constructor(
    public liveDocService: LiveDocService
  ) { }

  method() {

    this.liveDocService = this.liveDocService.getStream({
      document: destination,
      headers: {'X-Lang': 'En', Top: 20},
      deltaHandlingStrategy: (old, new) => new
    }).subscribe(/* ... */);

    this.liveDocService.connectionStatistics.subscribe(stats => this.callCenterStats = stats);

  }

Data Model

See file livedoc.info.txt in this folder.