Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaliborc/safe-filename
Convert strings to valid filenames or filepaths
https://github.com/jaliborc/safe-filename
filesystem javascript nodejs posix unix
Last synced: 25 days ago
JSON representation
Convert strings to valid filenames or filepaths
- Host: GitHub
- URL: https://github.com/jaliborc/safe-filename
- Owner: Jaliborc
- Created: 2019-05-14T18:55:37.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-14T19:31:23.000Z (over 5 years ago)
- Last Synced: 2024-12-01T14:47:18.310Z (about 1 month ago)
- Topics: filesystem, javascript, nodejs, posix, unix
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# safe-filename
[![](https://img.shields.io/npm/v/safe-filename.svg)](https://www.npmjs.com/package/safe-filename) ![](https://img.shields.io/badge/dependencies-none-blue.svg) ![](https://img.shields.io/npm/l/safe-filename.svg)Convert strings to a valid filenames or filepaths by replacing all reserved characters from UNIX and POSIX systems. It attempts to maintain the legibility of the original path or name by replacing each character from the reserved set `<>:"/\|?*` with a visually similar unicode character. Also guarantees no `.` at the end of a directory's or file's name.