<commit_before>Footrest: Lightweight ODM for CouchDB on Node
========

What is this is don't even?
---------------------------

Footrest lets you define models that will be backed by a Couch database.
It tries to work in exactly the way you'd expect it to, with an ActiveRecord-esque API.

Whilst it's still being put together, footrest will support callbacks (beforeSave, afterSave, etc) and validations.

**See below for examples.**

Footrest was designed to be used in **CoffeeScript**.
For now, using it in Javascript will be an exercise for the reader as it ties in nicely with CoffeeScript's classical inheritance.

Read the tests for a better idea how footrest can be used until better documentation is available

Running the tests
------------

0. `npm install`
0. `npm test`
0. Watch it pass ☺

Long example
------------

Hopefully this feels as natural to you as it does to me.

    Model = require('footrest').Model

    # this can be set per-model in the class definition, at runtime, etc
    Model.database = require('footrest').database('footrest')

    class Animal extends Model
      @type 'Animal'
      @attr 'species', 'name'

    class Dog extends Animal
      @attr 'name'
      @attr 'species', default: 'dog'
      @attr 'breed', default: 'greyhound'
      @attr('bites', default: true)

      strokeable: ->
        @cute or not @bites

    class Terrier extends Dog<commit_msg>clarified readme<commit_after>Footrest: Lightweight ODM for CouchDB on Node
========

What is this is don't even?
---------------------------

Footrest lets you define models that will be backed by a Couch database.
It tries to work in exactly the way you'd expect it to, with an ActiveRecord-esque API.

Whilst it's still being put together, footrest will support callbacks (beforeSave, afterSave, etc) and validations.

**See below for examples.**

Footrest was designed to be used in **CoffeeScript**.
For now, using it in Javascript will be an exercise for the reader as it ties in nicely with CoffeeScript's classical inheritance.

Read the tests for a better idea how footrest can be used until better documentation is available

Running the tests
------------

0. Run CouchDB on localhost:5984 in admin party mode
0. `npm test`
0. Watch it pass ☺

Long example
------------

Hopefully this feels as natural to you as it does to me.

    Model = require('footrest').Model

    # this can be set per-model in the class definition, at runtime, etc
    Model.database = require('footrest').database('footrest')

    class Animal extends Model
      @type 'Animal'
      @attr 'species', 'name'

    class Dog extends Animal
      @attr 'name'
      @attr 'species', default: 'dog'
      @attr 'breed', default: 'greyhound'
      @attr('bites', default: true)

      strokeable: ->
        @cute or not @bites

    class Terrier extends Dog
{'fraction_non_alphanumeric': 0.11072056239015818, 'fraction_numerical': 0.0035149384885764497, 'mean_word_length': 3.008450704225352, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2418957', 'n_tokens_mistral': 802, 'n_tokens_neox': 757, 'n_words': 380}