changing scope in npx apps

I want to make a npm package that should be run with npx instead of being installed locally, and I want to readFileSync a file from the folder in node package and writeFileSync to a file inside the end user’s computer

how would I do that