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

parse-server-moralis-streams

v0.0.5

Published

This Plugin adapts parse-server to support [streams](https://github.com/MoralisWeb3/streams-beta) with some extra benefits:

Downloads

7

Readme

Parse Server Moralis Streams

This Plugin adapts parse-server to support streams with some extra benefits:

  • True Upsert: Inserting directly to mongo via a bulkUpdate allows to handle millions of rows (parse-server slows downs insertions as the rows increase)

  • BigNumber Support: Allows bigNumbers to be inserted into MongoDB via numberDecimal.

Limitations

  • This plugin only works with MongoDB

  • Parse-Dashboard will not work due to numberDecimal, we will be releasing our version of dashboard with numberDecimal support soon.

Usage

Parse Server

First clone the parse server repo and install the dependencies.

This plugin was tested with v5.2.7 of parse server

git clone -b release https://github.com/parse-community/parse-server.git

Installation

Install the Plugin in your parse-server:

npm install parse-server-moralis-streams

Prepare Server

The Plugin needs to run some patches before the server starts. To do so, run the prepare script of the plugin.

npx parse-server-moralis-streams prepare

Streams Config

Create a folder in your project root called cloud and add a file called streams.json with the following content:

Example:

[
  {
    "tableName": "MyStream",
    "tag": "myStream"
  }
  // ...
]

The Streams object defines the streams that will be used by the plugin. It is an array of objects with the following properties.:

  • tableName (string): The name of the table that will be used to store the stream data in MongoDB
  • tag (string): The tag that will be used to identify the stream

Configuration

You should have a config file in your root folder. Usually its called config.json add the following to the config file:

{
    //..
    "moralisApiKey": "YOUR_MORALIS_WEB3_API_KEY",
    "streamsConfig": "./cloud/streams.json",
}

Start Server

Now you can run the server with following command:

npm start ./config.json

Specifying the path to your config file is required.

Setup Stream

The endpoint to receive webhooks is YOUR_SERVER_URL:PORT/streams. This is the URL that you should use when setting up a stream.

Done!

After you have configured the plugin and created a stream you can see the data in the dashboard. Note that the tableName will be concatenated with Txs and Logs meaning if you have a tableName called "MyTable" you will have two collections in mongoDB called "MyTableTxs" and "MyTableLogs", you will also have ERC20Transfers/Approvals and NFTTransfers/Approvals collections by default.