Created
June 2, 2018 04:24
-
-
Save neopunisher/0cb57cb1f4ce9821d12df333e571b4f3 to your computer and use it in GitHub Desktop.
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
(function(url, inj) { | |
inj(url).then(function() { | |
const node = new Ipfs() | |
node.on('error', errorObject => console.error(errorObject)) | |
node.on('ready', () => { | |
console.log('nodeready') | |
node.stop(() => { | |
console.log('node gone') | |
}) | |
}) | |
}) })('https://unpkg.com/ipfs/dist/index.min.js', (src, head = true) => new Promise(function(c, d) { | |
var a = document.createElement("script"); | |
a.src = src; | |
a.type = "text/javascript"; | |
a.onload = c; | |
a.onerror = d; | |
document[head ? 'head' : 'body'].appendChild(a) | |
})) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment