Closed. This question needs details or clarity。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗?添加详细信息并通过editing this post阐明问题。
                        
                        2年前关闭。
                                                                                            
                
        
有什么方法可以在不使用fs包的情况下在Node js中重命名文件。由于它在NPM存储库中显示Security holding package
 https://www.npmjs.com/package/fs

最佳答案

不建议使用fs模块。另外,它还有一个rename方法:

https://nodejs.org/api/fs.html#fs_fs_rename_oldpath_newpath_callback

10-06 12:27