how to browserify the complete bitcoinjs-lib?
See original GitHub issuePreviously I remember the install instructions for browserify contained something like browserify bitcoinjs-lib -s bitcoin > bitcoinjs.js
to build a standalone version of bitcoinjs.
Nowadays the instructions contain instructions to create an index.js with a myFunction
which does one particular thing (creating a random private key, in this case) and then exports that function.
How do I just export everything, i.e. create the entire bitcoinjs lib that I can include in a .html file just like before?
Perhaps a stupid question, in that case my apologies, but other than bitcoinjs I never used browserify for anything else and I’m not quite sure how this works.
Issue Analytics
- State:
- Created 6 years ago
- Comments:31 (15 by maintainers)
Top Results From Across the Web
How to compile BitcoinJS for browsers - Stack Overflow
I have compiled the bitcoinjs library with this command in CMD of Windows OS: ... cmd> browserify -r bitcoinjs-lib -s Bitcoin | uglifyjs...
Read more >bitcoinjs-lib-browser - npm
Browserified bundle for bitcoinjs-lib: Client-side Bitcoin Javscript ... Start using bitcoinjs-lib-browser in your project by running `npm i ...
Read more >BitcoinJS (bitcoinjs-lib) - JavaScript on Fiber - FIBJS
Standardized: Node community coding style, Browserify, Node's stdlib and Buffers. Fast: Optimized code, uses typed arrays instead of byte arrays for performance ...
Read more >bitcoinjs-lib | Yarn - Package Manager
BitcoinJS (bitcoinjs-lib) ... A javascript Bitcoin library for node.js and browsers. ... Display full readme Display full readme ...
Read more >Installing and using bitcoinjs. - Mobilefish.com
Node.js enables web developers to create an entire web application in JavaScript, ... Open a terminal and type:npm install bitcoinjs-lib -g
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@EvilJordan sure:
Make sure nodejs and npm are up to date
Create a new dir and from within that dir do
npm install bitcoinjs-lib browserify uglify-es
Create an
index.js
file in the same dir with this content:browserify -r . --standalone bitcoinjs > bitcoinjs.js
uglifyjs -c --mangle reserved=['BigInteger','ECPair','Point'] bitcoinjs.js > bitcoinjs.min.js
This creates both the full bitcoinjs.js and minified bitcoinjs.min.js.
Not the most informative, but I completely removed
browserify
from my system, reinstalled it, and now everything works ¯\_(ツ)_/¯Thanks for your help, @junderw!