diff --git a/index.js b/index.js index 481078e..c0ebdbc 100644 --- a/index.js +++ b/index.js @@ -1,12 +1,13 @@ var CryptoJS = require('crypto-js') -var path = require('path') -var includeFolder = require('include-folder') -var Wordlists = includeFolder(path.join(__dirname, 'wordlists')) var crypto = require('crypto') +var includeFolder = require('include-folder') +var path = require('path') +var wordlists = includeFolder(path.join(__dirname, 'wordlists')) + function BIP39(language) { language = language || 'en' - this.wordlist = JSON.parse(Wordlists[language]) + this.wordlist = JSON.parse(wordlists[language]) } BIP39.prototype.mnemonicToSeed = function(mnemonic, password) { diff --git a/test/index.js b/test/index.js index 9409737..5d46d6c 100644 --- a/test/index.js +++ b/test/index.js @@ -1,8 +1,8 @@ -var vectors = require('./vectors.json').english -var BIP39 = require('../index.js') -var wordlist = require('../wordlists/en.json') var assert = require('assert') +var wordlist = require('../wordlists/en.json') +var vectors = require('./vectors.json').english +var BIP39 = require('../index.js') var bip39 = new BIP39() describe('constructor', function(){