flatware
flatware copied to clipboard
Tabletop undefined when run with browserify
I am getting a "Tabletop undefined" error on my injected script with the API callback "Tabletop.singleton.loadsheets"
Here is my wrapper module/function
var Tabletop = require('tabletop') var tabletop module.exports = function (args, callback) { return function () { tabletop = Tabletop.init({ key: args.key, wanted:[args.sheet], callback:args.callback, prettyColumnNames :false, parseNumbers: false, proxy: (args.isProxy && typeof args.bucket !== 'undefined') ? 'http://'+args.bucket+'.s3.amazonaws.com' : undefined }) } } }
Adding the following line resolves the issue
window.Tabletop = window.Tabletop || Tabletop