├── .gitignore ├── README.md ├── bin └── mnemonics ├── package-lock.json ├── package.json └── src └── cli.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Optional REPL history 57 | .node_repl_history 58 | 59 | # Output of 'npm pack' 60 | *.tgz 61 | 62 | # Yarn Integrity file 63 | .yarn-integrity 64 | 65 | # dotenv environment variables file 66 | .env 67 | .env.test 68 | 69 | # parcel-bundler cache (https://parceljs.org/) 70 | .cache 71 | 72 | # next.js build output 73 | .next 74 | 75 | # nuxt.js build output 76 | .nuxt 77 | 78 | # vuepress build output 79 | .vuepress/dist 80 | 81 | # Serverless directories 82 | .serverless/ 83 | 84 | # FuseBox cache 85 | .fusebox/ 86 | 87 | # DynamoDB Local files 88 | .dynamodb/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mnemonics 2 | 3 | Run without installation to create a seed and display it as 12 words bip39 mnemonics: 4 | ``` 5 | npx mnemonics 6 | ``` 7 | 8 | --- 9 | 10 | Installation: 11 | 12 | ``` 13 | npm install -g mnemonics 14 | ``` 15 | 16 | Create a seed and display it as 12 words bip39 mnemonics: 17 | ``` 18 | mnemonics 19 | ``` 20 | 21 | Output: 22 | 23 | ``` 24 | purpose protect jealous embrace admit material all model anger scheme rotate entry 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /bin/mnemonics: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | require = require('esm')(module /*, options*/); 4 | require('../src/cli').cli(process.argv); -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mnemonics", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@types/node": { 8 | "version": "11.11.6", 9 | "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", 10 | "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==" 11 | }, 12 | "bip39": { 13 | "version": "3.0.2", 14 | "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.2.tgz", 15 | "integrity": "sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ==", 16 | "requires": { 17 | "@types/node": "11.11.6", 18 | "create-hash": "^1.1.0", 19 | "pbkdf2": "^3.0.9", 20 | "randombytes": "^2.0.1" 21 | } 22 | }, 23 | "cipher-base": { 24 | "version": "1.0.4", 25 | "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", 26 | "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", 27 | "requires": { 28 | "inherits": "^2.0.1", 29 | "safe-buffer": "^5.0.1" 30 | } 31 | }, 32 | "create-hash": { 33 | "version": "1.2.0", 34 | "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", 35 | "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", 36 | "requires": { 37 | "cipher-base": "^1.0.1", 38 | "inherits": "^2.0.1", 39 | "md5.js": "^1.3.4", 40 | "ripemd160": "^2.0.1", 41 | "sha.js": "^2.4.0" 42 | } 43 | }, 44 | "create-hmac": { 45 | "version": "1.1.7", 46 | "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", 47 | "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", 48 | "requires": { 49 | "cipher-base": "^1.0.3", 50 | "create-hash": "^1.1.0", 51 | "inherits": "^2.0.1", 52 | "ripemd160": "^2.0.0", 53 | "safe-buffer": "^5.0.1", 54 | "sha.js": "^2.4.8" 55 | } 56 | }, 57 | "esm": { 58 | "version": "3.2.25", 59 | "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", 60 | "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==" 61 | }, 62 | "hash-base": { 63 | "version": "3.0.4", 64 | "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", 65 | "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", 66 | "requires": { 67 | "inherits": "^2.0.1", 68 | "safe-buffer": "^5.0.1" 69 | } 70 | }, 71 | "inherits": { 72 | "version": "2.0.4", 73 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 74 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 75 | }, 76 | "md5.js": { 77 | "version": "1.3.5", 78 | "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", 79 | "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", 80 | "requires": { 81 | "hash-base": "^3.0.0", 82 | "inherits": "^2.0.1", 83 | "safe-buffer": "^5.1.2" 84 | } 85 | }, 86 | "pbkdf2": { 87 | "version": "3.0.17", 88 | "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", 89 | "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", 90 | "requires": { 91 | "create-hash": "^1.1.2", 92 | "create-hmac": "^1.1.4", 93 | "ripemd160": "^2.0.1", 94 | "safe-buffer": "^5.0.1", 95 | "sha.js": "^2.4.8" 96 | } 97 | }, 98 | "randombytes": { 99 | "version": "2.1.0", 100 | "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", 101 | "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", 102 | "requires": { 103 | "safe-buffer": "^5.1.0" 104 | } 105 | }, 106 | "ripemd160": { 107 | "version": "2.0.2", 108 | "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", 109 | "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", 110 | "requires": { 111 | "hash-base": "^3.0.0", 112 | "inherits": "^2.0.1" 113 | } 114 | }, 115 | "safe-buffer": { 116 | "version": "5.2.0", 117 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", 118 | "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" 119 | }, 120 | "sha.js": { 121 | "version": "2.4.11", 122 | "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", 123 | "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", 124 | "requires": { 125 | "inherits": "^2.0.1", 126 | "safe-buffer": "^5.0.1" 127 | } 128 | } 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mnemonics", 3 | "version": "1.1.3", 4 | "description": "create bip39 mnemonics", 5 | "main": "bin/mnemonics", 6 | "bin": { 7 | "mnemonics": "bin/mnemonics" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git@github.com:itinance/mnemonics.git" 12 | }, 13 | "homepage": "https://github.com/itinance/mnemonics", 14 | "files": [ 15 | "bin/", 16 | "src/" 17 | ], 18 | "scripts": { 19 | "test": "echo \"Error: no test specified\" && exit 1" 20 | }, 21 | "keywords": [ 22 | "bip39", 23 | "mnemonics", 24 | "bitcoin", 25 | "ethereum" 26 | ], 27 | "author": "Hagen Huebel (hhuebel@itinance.com)", 28 | "license": "MIT", 29 | "dependencies": { 30 | "bip39": "^3.0.2", 31 | "esm": "^3.2.25" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/cli.js: -------------------------------------------------------------------------------- 1 | const bip39 = require('bip39') 2 | 3 | export function cli(args) { 4 | const m = bip39.generateMnemonic(); 5 | console.log(m); 6 | } 7 | --------------------------------------------------------------------------------