{"_id":"filename-reserved-regex@4.0.1","bugs":{"url":"https://github.com/sindresorhus/filename-reserved-regex/issues"},"dist":{"shasum":"1d5219e42bcb022b2e12e98b4f59dec227f8e48a","tarball":"http://registry-npm.ywwl.com/filename-reserved-regex/download/filename-reserved-regex-4.0.1.tgz","fileCount":4,"integrity":"sha512-qUet2faQFKvtvVUsEf7wCrTURwxBOIZpspsLHGifw9QCWk55ITE2FrG8XhfQqG/uxMA1xEGFVQbL+Yfm0O94+Q==","signatures":[{"sig":"MEYCIQD3eE+YTMg0ezijvTkZTnO2cOKyYdEuZSORnkZH5fXzYAIhAO0MziwbrtVTI9pl+vDSoGF00vOhOhLpwXRKVAZeS4e3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCJZpBXlSe+F0ElkKQD0RI+JCFgmVa92Hkl3x9aDgEP9AIhAK+rgRtEl+AMaHryxTS3/ZfZ88h2BDpzV/2p3CP3c2uo"}],"unpackedSize":3586,"size":1974,"noattachment":false,"key":"/filename-reserved-regex/-/filename-reserved-regex-4.0.1.tgz"},"name":"filename-reserved-regex","type":"module","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":"d267eb977513e8137062ecca53a15fd78d5b6c92","license":"MIT","scripts":{"test":"xo && ava"},"version":"4.0.1","_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.1","_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.2","ava":"^6.4.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/filename-reserved-regex_4.0.1_1787921680653_0.602402142706737"},"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":1787921680735,"_cnpm_publish_time":1787921680735,"dist-tags":{"latest":"4.1.0"}}