Skip to main content
9 events
when toggle format what by license comment
Feb 11, 2022 at 1:59 comment added Alicia Basilio For imporrting in ES6 notation you might change to .mjs file extention ... all your code should be handled in that way. If you do not want to do it that way you can use require() notation in normal .js files. I underestand your fustration, i am a native Python developer more thatn Js Developer. You can read about it here digitalocean.com/community/tutorials/js-modules-es6 .. but what you need to do is change your file to .mjs ... and keep it like that all over your project, or import using 'require' and export using module.exports=
Feb 10, 2022 at 23:22 comment added Richard I found out there was a binary Bech32 that does the job. Thank you for the help!
Feb 10, 2022 at 6:56 comment added Richard in python this would be two lines of code: import <stringConvert> <stringConvert>.decode(encodedString)
Feb 10, 2022 at 6:55 comment added Richard I have tried copying the exact code into a file and importing that file and get an error saying only modules can import. If the only way to do this is to learn webpack and node so be it but I feel there has to be a simple way of doing this. that doesn't require learning all these new javascript tools I'm not concerned about being in browser, python or command line are fine too. I just need a working script that I can run that will convert this string into a usable address. I can figure out how to port it to my application if I can just figure that part out.
Feb 10, 2022 at 3:03 comment added Alicia Basilio Done, nothing obvious at all if you are new to JS. If you run it in node.js you do not need this... it is only needed if it is going to run in the browser... put the above code in another file that you import in the file where you are going to use the script that gets the address.
Feb 10, 2022 at 3:02 history edited Alicia Basilio CC BY-SA 4.0
added 409 characters in body
Feb 9, 2022 at 4:46 comment added Richard Could you elaborate on "loader to the above library". I installed the link you posted using npm, copied this code to a file called "index.js" and then tried running the code with "node index.js". I get an error saying "Loader is not defined". I apologize if there is something obvious I'm missing here, I have a programming background but am brand new to javascript.
Feb 7, 2022 at 5:12 history edited Alicia Basilio CC BY-SA 4.0
added 3 characters in body
Feb 7, 2022 at 5:04 history answered Alicia Basilio CC BY-SA 4.0