diff --git a/src/main.js b/src/main.js --- a/src/main.js +++ b/src/main.js @@ -3,4 +3,10 @@ import {blake2s} from "./blake.js"; import {Chacha20} from "./chacha.js"; export default {util,blake2s,Chacha20}; - \ No newline at end of file + +// export for tests running on Node +if(typeof module!=='undefined'&&module.hasOwnProperty('exports')){ + module.exports.util=util; + module.exports.blake2s=blake2s; + module.exports.Chacha20=Chacha20; +}