Skip to content

Instantly share code, notes, and snippets.

@PsychoLlama
Created March 12, 2016 05:11
Show Gist options
  • Save PsychoLlama/5894445f48254f6f3f00 to your computer and use it in GitHub Desktop.
Save PsychoLlama/5894445f48254f6f3f00 to your computer and use it in GitHub Desktop.
IndexedDB with gun-level
<!DOCTYPE html>
<html>
<head>
<title>IndexedDB Stuff</title>
<meta charset="utf-8">
</head>
<body>
<h1>IndexedDB through gunDB</h1>
<script src="bundle.js"></script>
</body>
</html>
var Gun = require('gun-level');
// so you can experiment in the browser
window.gun = new Gun({
level: {
// sets the "down" implementation
down: require('fruitdown')
}
});
// use with json-loader for best results
var webpack = require('webpack');
module.exports = {
entry: './index.js',
output: {
filename: 'bundle.js'
},
/*
Required to compile properly
(I'll look into making this seemless)
*/
plugins: [
new webpack.IgnorePlugin(/(gun\/lib\/wsp|fs)/)
],
/*
Will work without, but with warnings.
Warnings make me uncomfortable.
*/
module: {
loaders: [{
test: /\.json$/,
loader: 'json'
}]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment