ThumboJS - a NodeJS Thumbor Url Builder
ES2015-style Thumbor URL generator for Node JS.
browsers are not supported simply because to use the code in the browser would imply either having to supply the encryption-key to the browser or not use an encryption key, neither of which is a good idea.
a refactor of the following projects (with thanks to them!) ...
npm)
Install (requiresnpm install thumbor
Testing
You can run a basic set of tests (and linting) with:
npm test
You can run tests to validate the hash generation with:
npm run test-hashing
N.B. these require Python & Thumbor be installed locally
You can run tests against a running instance of Thumbor with:
npm run test-requests
N.B. by default the requests will be performed against "http://localhost:8888", you can change this by setting the env-var
THUMBOR_URL
Usage
const ThumborJS = ; // Your encryption key may be NULL, but if so your links will be unsafe (this is definitely NOT RECOMMENDED).const myKey = 'MY_KEY'; // init url generatorconst tugen = 'http://localhost:8888' myKey; // generate a urlconst url = tugen;