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

owservable

v1.2.2

Published

owservable backend

Downloads

725

Readme

owservable

Owservable backend

Reactive Stack JS replacement.

See owservable.github.io for more info.

Checkout my Reactive Stack Udemy course.

:books: Documentation

See the TypeDoc documentation.

:traffic_light: Testing:

See the Test coverage.

:clipboard: TODOs

  • Web Server abstraction
  • Database abstraction
  • Client-side datastore abstraction
  • Larga Data handling
  • Server-Side Events

:scroll: Uses

:floppy_disk: MongoDB Replica Set

Make sure your MongoDB database is running as a Replica Set: http://stojadinovic.net/2020/07/05/mongodb-change-streams-on-localhost-with-nodejs/

OwservableClient

This is the main class.

It processes client subscription requests, creates appropriate stores and subscribes to them to observe changes.

It extends RxJS:Subject, so that any websocket instance can subscribe to it, in order to forward updates back to the client.

IConnectionManager

Defines a Connection`Manager interface to be implemented by the application using this library.

This implementation is required for the above OwservableClient. An instance of OwservableClient is calling IConnectionManager methods accordingly.

DataMiddlewareMap

This is a map of all defined Data Middleware methods.

A Data Middleware is tied to a collection name and is used to modify an observed payload if necessary. For example, if based on users access permissions a portion of the payload needs to be removed or replaced, etc.

initiateWatchers

Method that initiates all watchers. Takes the project root folder path and a global folder name for the watchers.

Watchers can either perform simple tasks or add jobs to a queue, to be processed by the workers.

initiateCronjobs

Method that initiates all cronjobs. Takes the project root folder path and a global folder name for the cronjobs.

Cronjobs can either perform simple tasks or add jobs to a queue, to be processed by the workers.

initiateWorkers

Method that initiates all workers. Takes the project root folder path and a global folder name for the workers.

Workers can either perform simple tasks or take jobs from a queue.

MongoDB

MongoDBConnector

A MongoDB database connector class, used to initialize the database collection which Mongoose will then use.

processModels

This method parses all models and adds them to the CollectionsModelsMap if they pass validation. The method takes the project root folder path and a global folder name for the models and an optional folder name( s) to exclude, for example mixins and similar.

CollectionsModelsMap

This is a map of all Mongoose models and related MongoDB collections. It is populated automatically during the execution of processModels.

observableModel

Requires MongoDB 3.6+: This method returns an RxJS Subject that can be subscribed to and thus observe a particular MongoDB collection. This method takes a Mongoose model instance.

observableDatabase

Requires MongoDB 4.0+: This method returns an RxJS Subject that can be subscribed to and thus observe the entire MongoDB database.

Routes

processFastifyBlipp

This method stores all fastify routes into the RoutesMap in order to display them on request as a form of quick routes documentation.

This method is set as blippLog options attribute during fastify registration of the fastify-blipp plugin. Eg. server.register(fastifyBlipp, {blippLog: processFastifyBlipp});.

RoutesMap

This is a map of all available routes. It is populated automatically during the execution of processFastifyBlipp.

addFastifyRoutes

This method adds all routes to fastify automatically. It requires as parameters a fastify instance, the project root folder path and a global folder name for the routes.

cleanRelativePath

Helper metohd used in addFastifyRoutes to generate the route path from filename and file location relative to routes root folder.

Store

AStore

Abstract class for CountStore, DocumentStore and CollectionStore implementations.

EStoreType

Enum for existing store types: COUNT | DOCUMENT | COLLECTION.

CountStore

Count store, observes a particular query and returns only an integer representing the count of response rows.

DocumentStore

Document store, observes a particular query and returns all response rows.

CollectionStore

Collection store, observes a particular query and returns all response rows.

storeFactory

Store factory method, creates an appropriate AStore instance based on passed subscription parameters.

Types

These types are self explanatory.

  • CronJobType
  • WatcherType
  • WorkerType
  • StoreScopeType
  • StoreSubscriptionConfigType
  • StoreSubscriptionUpdateType
  • ConnectionManagerRefreshType

:scroll: License

Licensed under The Unlicense.

:sparkles: Contributors

This project follows the all-contributors specification.

Contributions of any kind welcome!

:chart_with_upwards_trend: UML

Checkout the UML diagram.