Add browser support (#1)

* add browser test target
* add browser-manual target
This commit is contained in:
Julian Gruber 2017-06-19 21:44:32 +02:00 committed by Emil Bay
parent abedfa6362
commit 642a68c2a1
2 changed files with 6 additions and 0 deletions

View File

@ -18,3 +18,5 @@ var plainText = new Buffer(cipher.length - sodium.crypto_secretbox_MACBYTES)
sodium.crypto_secretbox_open_easy(plainText, cipher, nonce, key) sodium.crypto_secretbox_open_easy(plainText, cipher, nonce, key)
console.log('Plaintext:', plainText.toString()) console.log('Plaintext:', plainText.toString())
if (typeof window !== 'undefined') window.close()

View File

@ -9,9 +9,13 @@
"siphash24": "^1.0.1" "siphash24": "^1.0.1"
}, },
"devDependencies": { "devDependencies": {
"browser-run": "^4.0.2",
"browserify": "^14.1.0",
"sodium-test": "^0.4.0" "sodium-test": "^0.4.0"
}, },
"scripts": { "scripts": {
"browser": "browserify example.js | browser-run",
"browser-manual": "browserify example.js | browser-run -p 1234",
"test": " node test.js" "test": " node test.js"
}, },
"browserify": { "browserify": {