Is there a way to rename a single file in npm scripts? I want to prepare files for distribution, but I need the built files to be named differently than they are in the source...
I have tried orn, but that only seems to work on the command line, not as an npm script. I'm specifically looking to just add a cross-platform dependency to do my project, rather than writing my own javascript script to copy files over.
My ideal solution is something I can include in the package.json
, as a one line command, e.g. rename old-file-name new-file-name
Sure. npm script
can run any node js file you want.
For example:
require('fs').rename(oldPath,newPath)
More Info:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With