node-cipher
node-cipher copied to clipboard
Webpack loader
Hi,
First of all: Thanks for node-cipher. It's a really nice tool!
Because I wanted to keep my file processing logic in webpack and not add it to package.json I ended up writing a small webpack loader that decrypts assets enrcypted by node-cipher: https://github.com/Ansimorph/decryption-loader
Feel free to give me feedback if you see any issues with the decryption process.
Would you mind a PR that adds this option to the tips-section of the documentation?
Oh this is neat, thanks! You can also just use the NodeCipher API to decrypt assets that were encrypted via the nodecipher CLI tool instead of messing with crypto. It might not be what you need in this case though, since it expects an input/output file.
~I'd also recommend taking a look at NodeCipher.Defaults. Use these to define the default settings for the decryption loader instead of creating two sources of truth~ Oh, never mind, looks like those aren't publicly accessible :( I'll have to fix that some time
PR's welcome :)
PR is underway.
I'd love to use your API and delegate all the actual logic to node-cipher, but webpack loaders really shouldn't work directly on the filesystem. Each loader is just a function transforming buffers or strings.
I'll be watching your repo, in case the defaults become public :)