Based off of: http://docs.sequelizejs.com/en/1.7.0/articles/express/
Create and initialize your a directory for your Express application.
$ mkdir sequelize-demo
const db = require('../models') | |
db.sequelize.sync().then(function () { | |
// Require our JSON | |
const cardJson = require('../.data/cards.json').cards | |
// For Each card, let's associate it! | |
cardJson.forEach(async card => { | |
// get the Model for the current card | |
const cardModel = await db.Card.findOne({ |
const fs = require('fs') | |
const cheerio = require('cheerio') | |
console.log('Reading File fooTable.html...') | |
const parsedHTML = fs.readFileSync('./footable.html', 'utf8') | |
const $ = cheerio.load(parsedHTML, { | |
normalizeWhitespace: true | |
}) |
<table id="cardTable" class="tablesorter"> | |
<thead> | |
<!-- Don't need this --> | |
</thead> | |
<tr id="card_1234" class="card-row" data-id="1234" data-name="card-name" data-elems="water fire"> | |
<td> | |
<span> | |
<!-- don't need --> | |
</span> | |
</td> |
Based off of: http://docs.sequelizejs.com/en/1.7.0/articles/express/
Create and initialize your a directory for your Express application.
$ mkdir sequelize-demo