You can grab it from the public repository (PRs accepted) and store the two files in extensions/server_connect/modules/
Feel free to fork and port to other server models. I work exclusively with nodejs so I don't have time to build and test it for the rest.
Make sure to install the package before npm i nanoid
It implements all methods from the API except for Custom Random Bytes Generator. If there is enough interest I will think about adding it although I would be surprised if anyone needs it.
It has two versions: a synchronous and an asynchronous. Just choose the one you need.
Thanks @JonL appreciate you taking the time to add something more to the community. Look forward to checking this out as I’ve yet to add a uuid. Perfect timing
No, just doing some more testing on my end, but i think its to something to do with not being able to ‘require’ the nanoid module.
The system error in more detail is: {"status":"500","message":"Module nanoid doesn't exist","stack":"Error: Module nanoid doesn't exist\n at App._exec (/opt/node_app/lib/core/app.js:253:27)\n at App.exec (/opt/node_app/lib/core/app.js:205:20)\n at App.define (/opt/node_app/lib/core/app.js:188:20)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)"}
Things that might be effecting it that i can think of:
Well uninstalling and reinstalling the npm package has at least added nanoid to the package.json file but my test still isn’t working (I’ve restarted the services and redeployed the Docker image a few times)
I’m going to try on a different/new project and see if that helps. I appreciate your help Jonas, i know you didn’t post this module to troubleshoot people’s issues lol
EDIT: I’ve tried on a different, mostly new project and had the same issue.
Error msg has changed slightly though and now has some references to an express/router wappler file.
{"status":"500","message":"Module nanoid doesn't exist","stack":"Error: Module nanoid doesn't exist\n at App._exec (/opt/node_app/lib/core/app.js:253:27)\n at App.exec (/opt/node_app/lib/core/app.js:205:20)\n at App.define (/opt/node_app/lib/core/app.js:188:20)\n at /opt/node_app/lib/core/middleware.js:13:40\n at Layer.handle [as handle_request] (/opt/node_app/node_modules/express/lib/router/layer.js:95:5)\n at next (/opt/node_app/node_modules/express/lib/router/route.js:137:13)\n at next (/opt/node_app/node_modules/express/lib/router/route.js:131:14)\n at next (/opt/node_app/node_modules/express/lib/router/route.js:131:14)\n at next (/opt/node_app/node_modules/express/lib/router/route.js:131:14)\n at next (/opt/node_app/node_modules/express/lib/router/route.js:131:14)"}