GitShow/sindresorhus/filenamify
sindresorhus

filenamify

Convert a string to a valid safe filename

by sindresorhus
Star on GitHubForknpm

JavaScript

524 stars29 forks13 contributorsActive · 1mo agoSince 2015v7.0.2MIT

Meet the team

See all 13 on GitHub →
sindresorhus
sindresorhus56 contributions
tomasklaen
tomasklaen4 contributions
BendingBender
BendingBender2 contributions
Richienb
Richienb2 contributions
orsett0
orsett01 contribution
MiAmigaAiva
MiAmigaAiva1 contribution
daveseco7
daveseco71 contribution
Gares95
Gares951 contribution

Languages

View on GitHub →
JavaScript100%

Commit activity

Last 12 weeks · 3 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Active · 1 in progress · Last activity 1mo ago
See all on GitHub →
fregante
Remove `browser` entry point; add `path` entry pointOpenPR

closes #43 copilot PR at https://github.com/fregante/filenamify/pull/1 by the way

fregante · 10mo ago
fregante
Move node-specific export to separate entry pointOpenIssue

Instead of duplicating the entry point for the browser (the default of and being the same), how about exporting and ? This way there's no footgun for browser users that either import or don't set a mapping.

fregante · 10mo ago

Recent fixes

View closed PRs →
Gares95
fix: handle Windows reserved names with extensionsMergedPR

Summary This fixes handling for Windows reserved device names followed by extensions. Windows treats reserved device names like as reserved even when followed by an extension, such as or . Previously, those names were returned unchanged. This change detects reserved device names before the first and inserts the replacement before the extension. Updates: handles extension-bearing Windows reserved device names by applying the replacement to the reserved base name before the extension. updates / expectations and adds regression coverage for , , and . Behavior change: extension-bearing Windows reserved device names now receive the replacement before the extension. Test plan [x] passes. [x] New regression tests cover Windows reserved names with extensions. [ ] CI rollup checked after open. Notes for maintainers Open to a different output shape if you prefer the replacement after the full filename instead of before the extension.

Gares95 · 2mo ago
kitschpatrol
White space is invalid replacementClosedIssue

Noticed this change from 6.0.0 → 7.0.0: Throws "Replacement string cannot contain reserved filename characters" The readme specifies that the replacement "Cannot contain: `:"/\|?* ` as an invalid replacement. Thanks for your work.

kitschpatrol · 9mo ago
benj-dobs
Consideration for unicode bidirectional markers?ClosedIssue

At the moment, does not filter out unicode bidi characters such as U+202E RIGHT-TO-LEFT-OVERRIDE. There is some concern that these could be used to construct malicious but innocent-looking filenames: becomes: My feeling is that this library should strip these characters, but I'm not 100% certain.

benj-dobs · 11mo ago
Structured data for AI agents

Repository: sindresorhus/filenamify. Description: Convert a string to a valid safe filename Stars: 524, Forks: 29. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Latest release: v7.0.2 (2mo ago). Open PRs: 1, open issues: 1. Last activity: 1mo ago. Community health: 85%. Top contributors: sindresorhus, tomasklaen, BendingBender, Richienb, orsett0, MiAmigaAiva, daveseco7, Gares95, marcelgerber, miraclx and others.

·@ofershap

Replace github.com with gitshow.dev