# largemouth

> A realtime communication framework

Latest version **0.3.9** (published 2014-02-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install largemouth
pnpm add largemouth
yarn add largemouth
bun add largemouth
```

Provides the command `largemouth`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.9 |
| Published | 2014-02-14 |
| First published | 2013-10-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+6 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Bret Little |
| Maintainers | blittle |

## Links

- npm: https://www.npmjs.com/package/largemouth
- Repository: https://github.com/blittle/largemouth
- Issues: https://github.com/blittle/largemouth/issues
- npm.io page: https://npm.io/package/largemouth

## Dependencies (4)

- [nopt](https://npm.io/package/nopt.md) ~2.1.2
- [async](https://npm.io/package/async.md) ~0.2.9
- [lodash](https://npm.io/package/lodash.md) ~2.2.1
- [socket.io](https://npm.io/package/socket.io.md) ~0.9.16

## Recent versions

- 0.3.9 (latest) — 2014-02-14
- 0.3.8 — 2014-01-10
- 0.3.7 — 2014-01-09
- 0.3.6 — 2014-01-09
- 0.3.3 — 2013-12-13
- 0.3.2 — 2013-12-09
- 0.3.1 — 2013-12-09
- 0.3.0 — 2013-11-29
- 0.2.4 — 2013-11-25
- 0.2.3 — 2013-11-19
- 0.2.2 — 2013-11-14
- 0.2.0 — 2013-11-08
- 0.1.11 — 2013-10-25
- 0.1.7 — 2013-10-21
- 0.1.6 — 2013-10-21
- … 4 more at https://npm.io/package/largemouth/versions

## README

![LargeMouth an open BAAS](largemouth.png) [![Build Status](https://travis-ci.org/blittle/largemouth.png?branch=master)](https://travis-ci.org/blittle/largemouth)
========

An open BAAS with a similar API to firebase.

##Motivation
[Firebase](http://firebase.com) is a Backend As A Service (BAAS) which allows developers to quickly build applications without worrying about the communication layer between the server and client. Firebase is awesome but the backend remains entirely proprietary. LargeMouth / SmallMouth attempt to recreate the Firebase api as an open-source project. Idealy a Firebase app could be easily moved to SmallMouth and vice versa.

LargeMouth is built on top of [Socket.io](http://socket.io/) and [NodeJS](http://nodejs.org/).

##Installation
```bash
npm install -g largemouth
```

##Boot Options
Change the server port (3000 default):
```bash
largemouth -p 3000
```
Change the location of the configuration file (working directory largemouth.js default):
```bash
largemouth -c ../myConfig.js
```

##SmallMouth
[SmallMouth](https://github.com/blittle/smallmouth) is the client side library.

##Configuration
Server configuration is defined within a JavaScript file by default located within the working directory of where LargeMouth is run.
The config file allows the following:
 - Permissions - The security permission definition.
 - Custom events - Define custom events which the server will listen for.

An example config file:

```javascript
module.exports = function(largemouth) {

	// Optionally define the server port here (commandline will override this value)
	largemouth.port = 3000;[[

	// The custom event will be passed a request object which will contain
	// any data sent from the client as well as the actual socket instance,
	// allowing you to respond to the client with custom events through socket.emit
	largemouth.events['someEvent'] = function(req, socket) {
			console.log('hi', req);
		}
	}

	// Only basic rules implemented, no expressions/variables
	largemouth.rules = {
		".read": true,
		".write": false,
		"chats": {
			".read": true,
			".write": true
		}
	}
}
```

##Release notes
 - 0.3.0 - Basic permissions and rules implemented. Fully implemented the resource.remove() method.
 - 0.2.4 - Load the config file and define custom events.
 - 0.2.0 - Don't send down entire datasets to notify clients of changes, rather send down what changed and allow the client to resolve the data.
 - 0.1.0 - Minimal portion of the Firebase API supported.

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/blittle/largemouth/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

---
_Source: https://npm.io/package/largemouth · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
