Last active
November 20, 2016 04:26
-
-
Save sebm/92301a9954b031a37e3da2d461cbc8fb to your computer and use it in GitHub Desktop.
I can't figure out nedb!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- clone this gist | |
- open index.html in browser | |
- observe an exception is thrown |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Nedb in-browser test</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/nedb/1.8.0/nedb.min.js"></script> | |
</head> | |
<body> | |
<script> | |
var db = new Nedb({filename: 'urls.db', autoload: true}); | |
db.find({}, (err, docs) => { | |
if (docs.length !== 1) { | |
throw "No docs found"; | |
} | |
}); | |
</script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"url":"https://google.com","visited":false,"_id":"jHZ10oRyx7WdOBjm"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment