Edit:
You could do something like...
"scripts": {
"main": "browserify index.js ${ADDITIONAL_FILES} -o assets/bundle/index.js"
}
Then call NPM like so:
ADDITIONAL_FILES="index2.js index3.js" npm run main
In this package.json snippet, the main script is interpolating a shell variable called ADDITIONAL_FILES. If ADDITIONAL_FILES is empty, it will be a blank string, which will not affect anything. If ADDITIONAL_FILES has some value, it will be substituted. In the call to NPM, we can set ADDITIONAL_FILES as we call npm, getting your extra files into things. Setting the variable like above will not persist. It will only live for the duration of this command, so you don't have to worry about ADDITIONAL_FILES being set in later runs.
I'm a little bit suspicious of why you need to do this. This suggests you have multiple entrypoints to your application, which is unusual. However, you know more about your project than anyone else :)
Hope this helps!
Old Answer:
This looks like a package.json file. Whatever is in scripts will be executed on the command line, so you have a great deal of flexibility here.
You could do something like...
"scripts": {
"command": "MY_DATA=$(cat some_file) script_that_uses_MY_DATA_environment_variable.sh"
}
If you're looking to get file names, you could write a small Node script to collect and output them or even use ls and awk if you're more comfortable with Bash. This is flexible. There are multiple solutions.
If you need more specific help, let me know with a comment :)
Edit: Alternatively, if you want to describe the context around this goal, we may be able to help you come up with an even better solution
Also, browserify will bundle modules recursively. As long as a Javascript file is referenced directly or indirectly by the first file, it will be included in the bundle. Ideally, you shouldn't have any orphaned, unconnected files, so this should cover most use cases.
Lastly, you have a typo in your package.json. It's browserify, not browserfy.