npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-fast-scripts

v0.26.0

Published

CLI to generate type-safe ThemeProvider and theme files for React Native

Downloads

92

Readme

Support for generate svgs, images, errors, themes, storages


npm install react-native-fast-scripts
"scripts": {
   "gen:svgs": "npx react-native-fast-scripts gen:svgs --dir './src/shared/assets/svgs'",
    "gen:images": "npx react-native-fast-scripts gen:images --dir './src/shared/assets/images'",
    "gen:errors": "npx react-native-fast-scripts gen:errors --dir './src/shared/assets/errors'",
    "gen:getter": "npx react-native-fast-scripts gen:getter --dir './src/domain/entities'",
    "gen:storage": "npx react-native-fast-scripts gen:storage --mmkv --asyncstorage --dir './src/shared/storages'",
    "gen:fonts": "npx react-native-fast-scripts gen:fonts --dir './src/shared/assets/fonts'",
    "gen:theme": "npx react-native-fast-scripts gen:theme --light --dark --dir './src/shared/themes'",
}
npm run gen:svgs
npm run gen:errors
npm run gen:getter --name AuthEntity
npm run gen:storage
npm run gen:fonts
npm run gen:theme

Mục đích

rename-files.mjs là script Node.js để đổi tên file hàng loạt trong thư mục, hỗ trợ:

Replace ký tự hoặc chuỗi (--from → --to)

Xoá ký tự/chuỗi (--to="" hoặc _blank)

Lọc file theo prefix (--startWith)

Rename trong toàn bộ thư mục con (--recursive)

Preview trước khi rename (--dry=true)

Hỗ trợ alias @ cho thư mục project-relative

rename-files.js

Mục đích

rename-files.mjs là script Node.js để đổi tên file hàng loạt trong thư mục, hỗ trợ:

  • Replace ký tự hoặc chuỗi (--from--to)
  • Xoá ký tự/chuỗi (--to="" hoặc _blank)
  • Lọc file theo prefix (--startWith)
  • Rename trong toàn bộ thư mục con (--recursive)
  • Preview trước khi rename (--dry=true)
  • Hỗ trợ alias @ cho thư mục project-relative

Cách sử dụng

Cú pháp cơ bản:

node rename-files.js --dir=<path> --from=<pattern> --to=<replacement> [options]

Tham số chính

| Tham số | Mô tả | |-----------------|-------| | --dir | Thư mục chứa file. Mặc định là . (current dir). Hỗ trợ alias @ cho project-relative. | | --from | Chuỗi hoặc ký tự muốn thay thế (required). Hỗ trợ regex pattern. | | --to | Chuỗi thay thế. Nếu "", _blank, blank → xoá ký tự/chuỗi. Mặc định "". | | --startWith | Chỉ đổi tên file bắt đầu bằng prefix này. | | --recursive | true|1 → rename trong toàn bộ subfolder. Mặc định false. | | --dry | true|1 → preview, không đổi thật. Mặc định false. |

Ví dụ sử dụng

1️⃣ Thay dấu - thành _ trong folder ./assets/icons:

node rename-files.mjs --dir=./assets/icons --from="-" --to="_"

2️⃣ Xoá dấu _ trong file:

node rename-files.mjs --dir=./assets/icons --from="_" --to=""
# hoặc dùng _blank
node rename-files.mjs --dir=./assets/icons --from="_" --to=_blank

3️⃣ Chỉ đổi file bắt đầu bằng ic-ac-:

node rename-files.mjs --dir=./assets/icons --startWith=ic-ac- --from="-" --to="_"

4️⃣ Rename toàn bộ file trong thư mục con:

node rename-files.mjs --dir=./assets/icons --from="-" --to="_" --recursive=true

5️⃣ Preview trước khi rename (dry run):

node rename-files.mjs --dir=./assets/icons --from="-" --to="_" --dry=true

6️⃣ Xoá khoảng trắng trong tên file:

node rename-files.mjs --dir=./assets/icons --from=" " --to=""

Lưu ý

  • Khi sử dụng shell, nếu muốn truyền chuỗi rỗng, hãy dùng --to='' hoặc _blank.
  • Script hỗ trợ cả Windows, macOS và Linux.
  • Khi dùng --recursive, cẩn thận với số lượng file lớn → nên dùng --dry=true trước.

Kết quả ví dụ

| Trước | Lệnh | Sau | |-------------------|-------------------------------------------|---------------| | ic-a-1.svg | --from="-" --to="_" | ic_a_1.svg | | ic_a_1.svg | --from="_" --to=_blank | ica1.svg | | icon test.svg | --from=" " --to="_" | icon_test.svg | | icon test.svg | --from=" " --to=_blank | icontest.svg |