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

crdt-md-editor

v1.1.3

Published

React Typescript CRDT based Collaborative Markdown Editor

Downloads

6

Readme

CRDT-MD-Editor

License

React Typescript CRDT based Collaborative Markdown Editor.

This app aims to show a collaborative text editing application using two eventual consitency backends: revision-based and CRDT-based. This demo shows that with a revision based approach, the user loses updates, either if updates are executed concurrently online, or if multiple users edit the document offline. To have an adequate semantics, the user needs to provide custom, non-trivial, code to merge the updates executed by each user. With the CRDT-based backend, update convergence is available out-of-the-box.

The current demo is implemented on top of PouchDB which offers replication and offline support, but can be easily ported on other equivalent backends. Later we will implement our backend without any third-party dependencies.

Setup guide

0.Requirements

For the next steps, you will need the following software:

1.Install Project dependencies

Go to project root directory and:

npm install

Run the standalone application

After, following Setup Guide above, running the app is as easy as:

npm start

(BETA/WIP) Use CRDT-MD-Editor React Component in another project

The React Component is built to be easily included in other web apps, you may want to simply contain the editor inside your website or blog.

1.Install the npm package to your React project

npm install crdt-md-editor --save

2.Choose the Editor instance you want to use

CRDT-MD-Editor offers two possibilities,

  • CollabMarkdownEditor Component: The lightweight version with minimal UI, and minimal JS backend. The easiest way to include a collaborative markdown textarea to your app;
  • RichCollabMarkdownEditor Component: The complete version with Rich UI, buttons toolbar, configurable UI and backend API ported to the Edge App.

3.Include the component in your .tsx and enjoy!

import './App.css';
import CollabMarkdownEditor from './Components/CollabMarkdownEditor';

function App() {
  return (
    <div className="App">
      <CollabMarkdownEditor />
    </div>
  );
}

export default App;

(BETA/WIP) Build for server production-ready deployment

npm install

# and enable CORS in CouchDB using the fetched script
# If your CouchDB instance is password protected, use -u <user> -p <password> options:
node node_modules/add-cors-to-couchdb/bin.js

# Then build the app using:
REACT_APP_SERVERURL="http://${MY_SERVER_ADDR}:5984/${MY_DBNAME}" \
REACT_APP_OFFLINE_FIRST=any \
npm run build
# Note: REACT_APP_OFFLINE_FIRST=any Enables Service Workers to run application offline

The build directory will now contain a static JS you can deploy in your server.

Replication support

If you want to run with cross-replica synchronization, just run a CouchDB Server, see CouchDB's installation guide