Skip to content

jessetane/contentful-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

contentful-db

Contentful database downloader / parser for use in the browser.

Why

If you have <= 1k entries, your database is likely to compress very well (Contentful's content delivery API uses gzip) which means it's generally quite feasible to download the entire thing at page load.

How

XMLHttpRequest

Example

var Contentful = require('contentful-db')

var db = new Contentful({
  space: 'WWW',
  key: 'XXX',
  contentTypes: {
    'YYY': 'pages',
    'ZZZ': 'menus'
  }
})

db.load(function () {
  console.log(db.entries)
  var pages = db.find({ type: 'pages' })
  pages.forEach(function (page) {
    console.log(page)
  })
})

License

Public Domain

About

Contentful database downloader / parser for use in the browser

Resources

Stars

Watchers

Forks

Packages

No packages published