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

@gorpacrate/firepad-old

v1.4.5

Published

Collaborative text editing powered by Firebase

Downloads

2

Readme

Firepad

Build Status Coverage Status Version

Firepad is an open-source, collaborative code and text editor. It is designed to be embedded inside larger web applications.

Live Demo

Visit firepad.io to see a live demo of Firepad in rich text mode, or the examples page to see it setup for collaborative code editing.

a screenshot of demo.firepad.io including a picture of two cats and a discussion about fonts

Setup

Firepad uses Firebase as a backend, so it requires no server-side code. It can be added to any web app by including a few JavaScript files

<!-- Firebase -->
<script src="https://cdn.firebase.com/js/client/2.2.4/firebase.js"></script>

<!-- CodeMirror -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.2.0/codemirror.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.2.0/codemirror.css"/>

<!-- Firepad -->
<link rel="stylesheet" href="https://cdn.firebase.com/libs/firepad/1.3.0/firepad.css" />
<script src="https://cdn.firebase.com/libs/firepad/1.3.0/firepad.min.js"></script>

and calling an init function.

<div id="firepad"></div>
<script>
  var firepadRef = new Firebase('<FIREBASE URL>');
  var codeMirror = CodeMirror(document.getElementById('firepad'), { lineWrapping: true });
  var firepad = Firepad.fromCodeMirror(firepadRef, codeMirror,
      { richTextShortcuts: true, richTextToolbar: true, defaultText: 'Hello, World!' });
</script>

Firepad supports rich text editing with CodeMirror and code editing via ACE. Check out the detailed setup instructions at firepad.io/docs.

What's Here

Here are some highlights of the directory structure and notable source files:

  • dist/ - output directory for all files generated by grunt (firepad.js, firepad.min.js, firepad.css, firepad.eot).
  • examples/ - examples of embedding Firepad.
  • font/ - icon font used for rich text toolbar.
  • lib/
    • firepad.js - Entry point for Firepad.
    • text-operation.js, client.js - Heart of the Operation Transformation implementation. Based on ot.js but extended to allow arbitrary attributes on text (for representing rich-text).
    • annotation-list.js - A data model for representing annotations on text (i.e. spans of text with a particular set of attributes).
    • rich-text-codemirror.js - Uses AnnotationList to track annotations on the text and maintain the appropriate set of markers on a CodeMirror instance.
    • firebase-adapter.js - Handles integration with Firebase (appending operations, triggering retries, presence, etc.).
  • test/ - Jasmine tests for Firepad (many of these were borrowed from ot.js).

Contributing

We love pull requests. If you'd like to contribute to Firepad, run the following commands to get your environment set up:

$ git clone https://github.com/firebase/firepad.git
$ cd firepad                # go to the firepad directory
$ npm install -g grunt-cli  # globally install grunt task runner
$ npm install -g bower      # globally install Bower package manager
$ npm install               # install local npm build / test dependencies
$ bower install             # install local JavaScript dependencies
$ grunt coffee              # build coffee once initially (so tests will work)
$ grunt watch               # watch for source file changes

grunt watch will watch for changes in the /lib/ directory and lint, concatenate, and minify the source files when a change occurs. The output files are written to the /dist/ directory.

You can run the test suite by navigating to file:///path/to/firepad/test/index.html or via the command line using grunt test.

Getting Started with Firebase

Firepad stores its data in a Firebase database. You can sign up here for a free Firebase account.

Getting Help

Join our Firepad Google Group to ask questions, request features, or share your Firepad apps with the community.