{"_id":"filename-reserved-regex@4.1.0","bugs":{"url":"https://github.com/sindresorhus/filename-reserved-regex/issues"},"dist":{"shasum":"389f86d11ca05692821affd20cf42d49f4d2b068","tarball":"http://registry-npm.ywwl.com/filename-reserved-regex/download/filename-reserved-regex-4.1.0.tgz","fileCount":5,"integrity":"sha512-pdgqcVlu789LoYmu0kz4pxSphL0pX/UVFFDJ/kTHk+1ZRc43UiokPZFsRV8OGxW49khh11rj54AhqczGIwLa+g==","signatures":[{"sig":"MEYCIQDaj7UlX9nKhEyIWPZ2twrs7WKRo7QGLyrUudZrLE54wwIhAKksg6Hde3csB6DbM42WdpBmpmDLbpTCC4VJecuHeAQy","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGjTf/SmgDut16WdOexo6fvvLx/JDPhLg1U2a4HfyIz/AiAyG+1fL2/tWwukBHZXgn2rhjnjpdNowi6wWsthkdq5OA=="}],"unpackedSize":4802,"size":2099,"noattachment":false,"key":"/filename-reserved-regex/-/filename-reserved-regex-4.1.0.tgz"},"name":"filename-reserved-regex","type":"module","types":"./index.d.ts","author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"engines":{"node":">=20"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"46487991020fc94ba03ac908b90306a539247bad","license":"MIT","scripts":{"test":"xo && node --test"},"version":"4.1.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"homepage":"https://github.com/sindresorhus/filename-reserved-regex#readme","keywords":["regex","regexp","filename","reserved","illegal"],"repository":{"url":"git+https://github.com/sindresorhus/filename-reserved-regex.git","type":"git"},"_npmVersion":"12.0.1","description":"Regular expression for matching reserved filename characters","directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"sideEffects":false,"_nodeVersion":"22.23.3","_hasShrinkwrap":false,"devDependencies":{"xo":"^5.0.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/filename-reserved-regex_4.1.0_1791396224819_0.9817708587850573"},"readme":"# filename-reserved-regex\n\n> Regular expression for matching reserved filename characters\n\nOn Unix-like systems `/` is reserved and [`<>:\"/\\|?*`](https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions) as well as non-printable characters `\\u0000-\\u001F` on Windows. Windows also doesn't allow names ending in space or period.\n\n## Install\n\n```sh\nnpm install filename-reserved-regex\n```\n\n## Usage\n\n```js\nimport filenameReservedRegex, {windowsReservedNameRegex} from 'filename-reserved-regex';\n\nfilenameReservedRegex().test('foo/bar');\n//=> true\n\nfilenameReservedRegex().test('foo-bar');\n//=> false\n\n'foo/bar'.replace(filenameReservedRegex(), '!');\n//=> 'foo!bar'\n\nwindowsReservedNameRegex().test('aux');\n//=> true\n```\n\n## API\n\n### filenameReservedRegex()\n\nReturns a regex that matches all invalid characters.\n\n### windowsReservedNameRegex()\n\nReturns an exact-match case-insensitive regex that matches reserved Windows device names.\n\nThese include `CON`, `PRN`, `AUX`, `NUL`, `CONIN$`, `CONOUT$`, `COM1` through `COM9`, `COM¹`, `COM²`, `COM³`, `LPT1` through `LPT9`, `LPT¹`, `LPT²`, and `LPT³`. `COM0` and `LPT0` are conservatively matched for compatibility with previous versions.\n\nNames followed by an extension are also matched because, for example, `NUL.txt` and `NUL.tar.gz` are both equivalent to `NUL`. ASCII spaces before the extension or at the end of the name are ignored in the same way as on Windows.\n","publish_time":1791396224907,"_cnpm_publish_time":1791396224907,"dist-tags":{"latest":"4.1.0"}}