I would like to try out an AES encryption facility: https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js But without using a browser, with a command line tool, if it exists at all. Which can import this aes.js file, and I can call the different functions from a REPL, or just interpreting a script which utilizes this aes library, and gives output on STDOUT - without a browser.
Node can do this. Download the file to a local ./aes.js
or something, and then start node
prompt and:
> .load aes.js
Bam
Unless by 'or' you mean that you need both to be able to use in from a REPL and import it from a script. I don't know if it's possible to import unexported names from another file (the special .load
command-line thing seems to dump the code into the current scope). But if you can access the source of the library instead of the bundle or install it with NPM, you should be able to import it with const CryptoJS = require('crypto-js')
(cause node needs module.exports
to be used in order to import names from it).