Verified Commit 625dbddf authored by Aral Balkan's avatar Aral Balkan
Browse files

Add Lovecraft Country example from the blog post

parent 580154ab
<script src="db/episodes.js"></script>
<h1>Lovecraft Country</h1>
<p>Episodes and ratings from <a href='https://www.imdb.com/title/tt6905686/episodes?season=1'>IMDB</a>:</p>
<ul>
<script>
episodes.forEach(episode => {
document.write(`<li><strong>${episode.title}</strong> ⭐ ${episode.rating}</li>`)
})
</script>
</ul>
const JSDB = require('../..')
// Open your database (creating it if it doesn’t exist)
// It will be stored in a directory called “db”.
const db = JSDB.open('db')
// Create a “table” on it. Tables can be arrays or objects.
if (!db.episodes) {
db.episodes = [
{title: 'Sundown', rating: 8.4},
{title: 'Whitey’s on the Moon', rating: 7.1},
{title: 'Holy Ghost', rating: 7.7},
{title: 'A History of Violence', rating: 7.6},
{title: 'Strange Case', rating: 7.1},
{title: 'Meet me in Daegu', rating: 8.4},
{title: 'I am.', rating: 7.1},
// {title: 'Jig-a-Bobo', rating: 8.4},
// {title: 'Rewind 1921', rating: 8.6},
// {title: 'Full Circle', rating: 7.0},
]
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment