GitShow/sindresorhus/slash
sindresorhus

slash

Convert Windows backslash paths to slash paths

by sindresorhus
Star on GitHubForknpm

JavaScript

337 stars57 forks8 contributorsQuiet · 3y agoSince 2013v5.1.0MIT

Meet the team

See all 8 on GitHub →
sindresorhus
sindresorhus27 contributions
dario-piotrowicz
dario-piotrowicz1 contribution
BendingBender
BendingBender1 contribution
birjj
birjj1 contribution
kevva
kevva1 contribution
paulmillr
paulmillr1 contribution
Richienb
Richienb1 contribution
emagers
emagers1 contribution

Languages

View on GitHub →
JavaScript84.8%
TypeScript15.2%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

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

Recent fixes

View closed PRs →
hyperz111
perf: avoid regex to improve performanceMergedPR

Resend #27. This is have some changes: Avoid regex & use string method to improve performance. Early return if it's a \*NIX path (don't have Windows forward slash). Tested on Android (3GB RAM). All fixture paths are AI-generated. I hope you're okay with this :). Windows Paths UNIX Paths Mixed Paths UNC Paths (don't care about this)

hyperz111 · 6mo ago
hyperz111
perf: avoid regex to improve performanceMergedPR

Benchmark result (_use Android btw_): Use for benchmarking, 1.74x faster.

hyperz111 · 6mo ago
emagers
Removes regex from extended length path checkMergedPR

The existing method uses regex to check if the first four characters indicate that the path is an extended-length path. This is not as performant as using which checks the first four characters without using a regex. Using the package, I compared the performance by evaluating the following strings: The resulting data backed up the idea for performance improvement: NORMAL_STRING_WITH_REPLACE original x 4,243,922 ops/sec ±0.95% (88 runs sampled) new x 4,591,650 ops/sec ±0.78% (91 runs sampled) ~8.1% increase in ops/sec EXTENDED_PATH original x 26,703,612 ops/sec ±1.16% (93 runs sampled) new x 43,472,723 ops/sec ±3.22% (87 runs sampled) ~62% increase in ops/sec NORMAL_STRING_NO_REPLACE original x 10,698,194 ops/sec ±0.82% (92 runs sampled) new x 12,566,525 ops/sec ±0.80% (94 runs sampled) ~17% increase in ops/sec Note that these benchmarks were run on my local notebook though repeated multiple times with similar results.

emagers · 3y ago
Structured data for AI agents

Repository: sindresorhus/slash. Description: Convert Windows backslash paths to slash paths Stars: 337, Forks: 57. Primary language: JavaScript. Languages: JavaScript (84.8%), TypeScript (15.2%). License: MIT. Latest release: v5.1.0 (3y ago). Open PRs: 0, open issues: 0. Last activity: 3y ago. Community health: 85%. Top contributors: sindresorhus, dario-piotrowicz, BendingBender, birjj, kevva, paulmillr, Richienb, emagers.

·@ofershap

Replace github.com with gitshow.dev