Git Product home page Git Product logo

rename's Introduction

Rename - 在线文件批量重命名工具

icon

🍉 批量重命名工具

https://rename.jgrass.xyz/

提供常用的文件批量重命名操作,无需下载安装,即用即走。

🍉 实现原理与隐私问题

使用的是浏览器加载文件的相关 API,读取本地文件名称信息(不读取文件内容),同样使用浏览器提供的 API 来修改文件名称。

所有数据只保留在本地浏览器内存中,关闭页面时清空,不会上传服务器(这个工具不需要也没有服务器)。

并且每一次使用,都需要你的手动允许和授权(导入文件或文件夹时)。具体用到的浏览器 API 如下:

Window:showOpenFilePicker() 方法 - Web API 接口参考 | MDN
Window:showDirectoryPicker() 方法 - Web API 接口参考 | MDN
FileSystemFileHandle - Web API 接口参考 | MDN

🍉 缘起

批量重命名是一个低频但时不时又会遇到的需求,为此专门下载一个软件过于大费周章。都 3202 年了,应该可以用 web 来做了吧。果然发现了相关的 API,于是有了这个在线工具。

🍉 浏览器兼容 & 已知问题

因为使用了实验性的 API,浏览器兼容会有问题。如果发现功能有问题,请使用最新版 Edge/Chrome 浏览器。

"showOpenFilePicker" | Can I use...

核心 API:FileSystemFileHandle.move() for local files - Chrome Platform Status

已知问题FileSystemFileHandle.move 方法对文件进行重命名时,会更改文件的“修改时间”,而手动重命名或使用本地重命名工具,不会有这个问题。

🍉 高级技巧

提供的预设规则,无法满足一些个性化的需求,可以使用正则表达式替换完成一些高级功能。
或者直接编写 js 代码。🤣

正则替换底层实现:String.replace(pattern, replacement) String.prototype.replace() - JavaScript | MDN

可以参考这里的案例:#2,或者直接使用本地运行的重命名工具,这里有一些网友的推荐:#3


部分 UI 设计参考了 utools 中的批量重命名插件。

rename's People

Contributors

jasongrass avatar

Stargazers

Janson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.