'how to pass arguments back to npm

I have scripts like this:

{
 scripts: {
   "example": "task --arg1"
 }
}

and I run this script like so npm run example if I want to pass arguments to npm (not to example) I would do npm run example -ws and to pass arguments to example npm run example -- --arg2

now I want to set npm arguments in the script itself to be passed back to npm and not example

{
 scripts: {
   "example": "task --arg1 -ws"
 }
}

how to make -ws here recognised by npm instead of example



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source