Currently, I am working on developing an npm package that will automatically insert a specific npm script into any package.json file that it is being used. Unfortunately, after going through the npm package.json/script documentation, I haven't been able to make much progress in this regard.
My main goal is to achieve the following:
- I want to install an npm package (let's call it 'cool-thing')
- Upon installation, 'cool-thing' should add a custom npm script to the existing package.json file
- After running 'cool-thing' in the command line, it should carry out the action specified in the package.json file
If anyone has any insights on how I could accomplish this task, please share your knowledge!