0.6.4 • Published 10 years ago

quickfire v0.6.4

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

QuickFire

QuickFire is a quick way to get up and running with Firebase on Node. Just create a model:

// Article.js

import { Model } from 'quickfire'

export default class Article extends Model {}

And that's it!

Currently supported methods:

  • Model.create(attributes)
  • Model.find(id)
  • Model.count()
  • modelInstance.update(attributes)
  • modelInstance.set(attributes)
  • modelInstance.delete()
co(function*() { // Use co to avoid callback hell, but you can use promises if you want
  // Create an article
  var article = yield Article.create({
    title: "Super provocative headline",
    url: "https://www.clickbaitnews.com"
  })

  // Update only the title key
  article = yield article.update({
    title: "More reasonable headline"
  })

  // Replace all keys (except id, createdAt, updatedAt)
  article = yield article.set({
    content: "Persuasive article content."
  })

  let articleId = article.id // UUID
  let articleCreatedAt = article.createdAt // Set automatically upon .create()
  let articleUpdatedAt = article.updatedAt // Set automatically upon .create(), .update(), .set()

  let sameArticle = yield Article.find(articleId) // Look up by UUID
  let numArticles = yield Article.count() // Number of articles, 1

  yield article.delete() // Delete the article
})
0.6.4

10 years ago

0.6.3

10 years ago

0.6.2

10 years ago

0.6.1

10 years ago

0.6.0

10 years ago

0.5.0

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago