Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including hoodie with all npm packages installed. Try it out:

var hoodie = require("hoodie")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

hoodie v24.2.5

A generic backend with a client API for Offline First applications


A generic backend with a client API for Offline First applications

Build Status Coverage Status Dependency Status devDependency Status

Hacktoberfest 2016 Banner The Low-Profile Dog Hoodie Mascot
  <h2> Hallo <a href="">Hacktoberfest</a> Friends 🐶👋</h2>
    We have some great issues prepared for you to work on, check out our <a href="">Hoodie Camp</a> repository :) If you have any questions or just want to say hi, please ping us <a href="">on Twitter</a> or join our <a href="">Chat</a>. We are looking forward to meet you all! Happy hacktobering!  🙌💻

Hoodie lets you build apps without thinking about the backend and makes sure that they work great independent from connectivity.

This is Hoodie’s main repository. It starts a server and serves the client API. Read more about how the Hoodie server works.

A good place to start is our Tracker App. You can play around with Hoodie’s APIs in the browser console and see how it works all together in its simple HTML & JavaScript code.

If you have any questions come say hi in our chat.


Hoodie is a Node.js package. You need Node Version 4 or higher and npm Version 2 or higher, check your installed version with node -v and npm -v.

First, create a folder and a package.json file

mkdir my-app
cd my-app
npm init -y

Next install hoodie and save it as dependency

npm install --save hoodie
Add a `"start"` script and set it to `"hoodie"` in your `package.json`. The result should look something like this
  "name": "my-app",
  "version": "1.0.0",
  "scripts": {
    "start": "hoodie",
    "test": "echo \"Error: no test specified\" && exit 1"
  "dependencies": {
    "hoodie": "^24.0.0"

There might be more properties and 24.0.0 will likely be a higher number, but that’s okay.

Now run npm start to start your Hoodie app.

You can find a more thorough description in our Getting Started Guide.


hoodie can be used as as CLI (Command Line Interface) or as hapi plugin. The options are slightly different, see below


Once you finished the setup, you can start your hoodie server with

npm start

To pass CLI options to Hoodie, you have to separate them with --, for example:

npm start -- --port=8090 --inMemory

Available CLI options are

--address''Address to which Hoodie binds
--data'.hoodie'Data path
--dbUrlIf provided, uses external CouchDB. URL has to contain credentials.
--loglevel'warn'One of: silent, error, warn, http, info, verbose, silly
-m, --inMemoryfalseWhether to start the PouchDB Server in memory
--port8080Port-number to run the Hoodie App on
--public'public'path to static assets
--url-Optional: external URL at which Hoodie Server is accessible (e.g.
-h, --help, --usage-Prints help and available options
-v, --version-Shows Hoodie version

Hoodie CLI is using rc for configuration, so the same options can be set with environment variables and config files. Environment variables are prefixed with hoodie_. Examples: hoodie_port=8090 or hoodie_inMemory=true. Configuration files can be in INI or JSON format and can be placed at different locations. Most commonly you would place a .hoodierc file in your app’s directory, and it can look like this

  port: 8090,
  inMemory: true

The priority of configuration:

  1. command line arguments
  2. Environment variables
  3. .hoodierc files
  4. Your app’s defaults form "hoodie" key in "package.json"
  5. Hoodie’s defaults as shown in table above

hapi plugin

You can load hoodie as hapi plugin to use it in your existing hapi application:

var Hapi = require('hapi')
var hoodie = require('hoodie').register

var server = new Hapi.Server()
  host: 'localhost',
  port: 8000

  register: hoodie,
  options: { // pass options here
    inMemory: true,
    public: 'dist'
}, function (error) {
  if (error) {
    throw error

  server.start(function (error) {
    if (error) {
      throw error

    console.log(('Server running at:',

The available options are

optiondefaultdescription'.hoodie'Data path
paths.public'public'Public path
dbPouchDB options
inMemoryfalseIf set to true, configuration and other files will not be read from / written to the file system
client{}Hoodie Client options. client.url is set based on hapi’s
account{}Hoodie Account Server options. account.admins, account.secret and account.usersDb are set based on db option above.
store{}Hoodie Store Server options. store.couchdb, store.PouchDB are set based on db option above. store.hooks.onPreAuth is set to bind user authentication for Hoodie Account to Hoodie Store.


Local setup

git clone
cd hoodie
npm install

The hoodie test suite is run with npm test. You can read more about testing Hoodie.

You can start hoodie for itself using npm start. It will serve the contents of the public folder.


Become a backer and show your Hoodie support!

Official Sponsors

Show your support for Hoodie and help us sustain our inclusive community. We will publicly appreciate your support and are happy to get your word out, as long as it aligns with our Code of Conduct.


Apache 2.0

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free