I am trying to get a third-party package to work. I first tried the example 'os', and I got it functional.
Now I am trying to get the package 'node-dsmr' to function in a similar way.
I installed the package in ~/.node-red as it says in the manual, with command npm install node-dsmr.
You are mixing up the two different ways it is possible to add additional modules to the Function node.
Option 1:
edit your settings file as you have done and use const dsmrParser = global.get("dsmrParser")
Option 2:
Do not edit settings.js. Add the module to the 'Setup' tab of the Function node. If you do that, you have to provide the npm module name - node-dsmr - the runtime will then ensure it is installed and loaded. I'm not 100% sure if it'll work doing node-dsmr/lib/parser.. you may have to require node-dsmr and then 'explore' the object that returns from find the parser bit of it.